resourceevents

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package resourceevents implements MCP tool handlers for GitLab resource label events, milestone events, and state events. These track changes to labels, milestones, and states on issues and merge requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatIterationEventMarkdown

func FormatIterationEventMarkdown(out IterationEventOutput) string

FormatIterationEventMarkdown formats a single iteration event.

func FormatIterationEventsMarkdown

func FormatIterationEventsMarkdown(out ListIterationEventsOutput) string

FormatIterationEventsMarkdown formats a list of iteration events.

func FormatLabelEventMarkdown

func FormatLabelEventMarkdown(out LabelEventOutput) string

FormatLabelEventMarkdown formats a single label event.

func FormatLabelEventsMarkdown

func FormatLabelEventsMarkdown(out ListLabelEventsOutput) string

FormatLabelEventsMarkdown formats a list of label events.

func FormatMilestoneEventMarkdown

func FormatMilestoneEventMarkdown(out MilestoneEventOutput) string

FormatMilestoneEventMarkdown formats a single milestone event.

func FormatMilestoneEventsMarkdown

func FormatMilestoneEventsMarkdown(out ListMilestoneEventsOutput) string

FormatMilestoneEventsMarkdown formats a list of milestone events.

func FormatStateEventMarkdown

func FormatStateEventMarkdown(out StateEventOutput) string

FormatStateEventMarkdown formats a single state event.

func FormatStateEventsMarkdown

func FormatStateEventsMarkdown(out ListStateEventsOutput) string

FormatStateEventsMarkdown formats a list of state events.

func FormatWeightEventsMarkdown

func FormatWeightEventsMarkdown(out ListWeightEventsOutput) string

FormatWeightEventsMarkdown formats a list of weight events.

func RegisterMeta

func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)

RegisterMeta registers the gitlab_resource_event meta-tool.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers individual resource event tools.

Types

type GetIssueIterationEventInput

type GetIssueIterationEventInput struct {
	ProjectID        toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID         int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	IterationEventID int64                `json:"iteration_event_id" jsonschema:"Iteration event ID,required"`
}

GetIssueIterationEventInput defines parameters for getting a single issue iteration event.

type GetIssueLabelEventInput

type GetIssueLabelEventInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID     int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	LabelEventID int64                `json:"label_event_id" jsonschema:"Label event ID,required"`
}

GetIssueLabelEventInput defines parameters for getting a single issue label event.

type GetIssueMilestoneEventInput

type GetIssueMilestoneEventInput struct {
	ProjectID        toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID         int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	MilestoneEventID int64                `json:"milestone_event_id" jsonschema:"Milestone event ID,required"`
}

GetIssueMilestoneEventInput defines parameters for getting a single issue milestone event.

type GetIssueStateEventInput

type GetIssueStateEventInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID     int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	StateEventID int64                `json:"state_event_id" jsonschema:"State event ID,required"`
}

GetIssueStateEventInput defines parameters for getting a single issue state event.

type GetMRLabelEventInput

type GetMRLabelEventInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID        int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	LabelEventID int64                `json:"label_event_id" jsonschema:"Label event ID,required"`
}

GetMRLabelEventInput defines parameters for getting a single MR label event.

type GetMRMilestoneEventInput

type GetMRMilestoneEventInput struct {
	ProjectID        toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID            int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	MilestoneEventID int64                `json:"milestone_event_id" jsonschema:"Milestone event ID,required"`
}

GetMRMilestoneEventInput defines parameters for getting a single MR milestone event.

type GetMRStateEventInput

type GetMRStateEventInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID        int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	StateEventID int64                `json:"state_event_id" jsonschema:"State event ID,required"`
}

GetMRStateEventInput defines parameters for getting a single MR state event.

type IterationEventIterationOutput

type IterationEventIterationOutput struct {
	ID        int64  `json:"id"`
	IID       int64  `json:"iid"`
	Sequence  int64  `json:"sequence"`
	GroupID   int64  `json:"group_id"`
	Title     string `json:"title"`
	State     int64  `json:"state"`
	WebURL    string `json:"web_url,omitempty"`
	StartDate string `json:"start_date,omitempty"`
	DueDate   string `json:"due_date,omitempty"`
}

IterationEventIterationOutput represents the iteration in an iteration event.

type IterationEventOutput

type IterationEventOutput struct {
	toolutil.HintableOutput
	ID           int64                         `json:"id"`
	Action       string                        `json:"action"`
	CreatedAt    string                        `json:"created_at"`
	ResourceType string                        `json:"resource_type"`
	ResourceID   int64                         `json:"resource_id"`
	UserID       int64                         `json:"user_id"`
	Username     string                        `json:"username"`
	Iteration    IterationEventIterationOutput `json:"iteration"`
}

IterationEventOutput represents a resource iteration event.

func GetIssueIterationEvent

func GetIssueIterationEvent(ctx context.Context, client *gitlabclient.Client, input GetIssueIterationEventInput) (IterationEventOutput, error)

GetIssueIterationEvent gets a single iteration event for an issue.

type LabelEventLabelOutput

type LabelEventLabelOutput struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Color       string `json:"color"`
	TextColor   string `json:"text_color"`
	Description string `json:"description"`
}

LabelEventLabelOutput represents the label in a label event.

type LabelEventOutput

type LabelEventOutput struct {
	toolutil.HintableOutput
	ID           int64                 `json:"id"`
	Action       string                `json:"action"`
	CreatedAt    string                `json:"created_at"`
	ResourceType string                `json:"resource_type"`
	ResourceID   int64                 `json:"resource_id"`
	UserID       int64                 `json:"user_id"`
	Username     string                `json:"username"`
	Label        LabelEventLabelOutput `json:"label"`
}

LabelEventOutput represents a resource label event.

func GetIssueLabelEvent

func GetIssueLabelEvent(ctx context.Context, client *gitlabclient.Client, input GetIssueLabelEventInput) (LabelEventOutput, error)

GetIssueLabelEvent gets a single label event for an issue.

func GetMRLabelEvent

func GetMRLabelEvent(ctx context.Context, client *gitlabclient.Client, input GetMRLabelEventInput) (LabelEventOutput, error)

GetMRLabelEvent gets a single label event for a merge request.

type ListIssueIterationEventsInput

type ListIssueIterationEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	toolutil.PaginationInput
}

ListIssueIterationEventsInput defines parameters for listing issue iteration events.

type ListIssueLabelEventsInput

type ListIssueLabelEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	toolutil.PaginationInput
}

ListIssueLabelEventsInput defines parameters for listing issue label events.

type ListIssueMilestoneEventsInput

type ListIssueMilestoneEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	toolutil.PaginationInput
}

ListIssueMilestoneEventsInput defines parameters for listing issue milestone events.

type ListIssueStateEventsInput

type ListIssueStateEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	toolutil.PaginationInput
}

ListIssueStateEventsInput defines parameters for listing issue state events.

type ListIssueWeightEventsInput

type ListIssueWeightEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int64                `json:"issue_iid" jsonschema:"Issue internal ID,required"`
	toolutil.PaginationInput
}

ListIssueWeightEventsInput defines parameters for listing issue weight events.

type ListIterationEventsOutput

type ListIterationEventsOutput struct {
	toolutil.HintableOutput
	Events     []IterationEventOutput    `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListIterationEventsOutput wraps a list of iteration events.

func ListIssueIterationEvents

func ListIssueIterationEvents(ctx context.Context, client *gitlabclient.Client, input ListIssueIterationEventsInput) (ListIterationEventsOutput, error)

ListIssueIterationEvents lists iteration events for an issue.

type ListLabelEventsOutput

type ListLabelEventsOutput struct {
	toolutil.HintableOutput
	Events     []LabelEventOutput        `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListLabelEventsOutput wraps a list of label events.

func ListIssueLabelEvents

func ListIssueLabelEvents(ctx context.Context, client *gitlabclient.Client, input ListIssueLabelEventsInput) (ListLabelEventsOutput, error)

ListIssueLabelEvents lists label events for an issue.

func ListMRLabelEvents

func ListMRLabelEvents(ctx context.Context, client *gitlabclient.Client, input ListMRLabelEventsInput) (ListLabelEventsOutput, error)

ListMRLabelEvents lists label events for a merge request.

type ListMRLabelEventsInput

type ListMRLabelEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID     int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	toolutil.PaginationInput
}

ListMRLabelEventsInput defines parameters for listing merge request label events.

type ListMRMilestoneEventsInput

type ListMRMilestoneEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID     int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	toolutil.PaginationInput
}

ListMRMilestoneEventsInput defines parameters for listing MR milestone events.

type ListMRStateEventsInput

type ListMRStateEventsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID     int64                `json:"mr_iid" jsonschema:"Merge request internal ID,required"`
	toolutil.PaginationInput
}

ListMRStateEventsInput defines parameters for listing MR state events.

type ListMilestoneEventsOutput

type ListMilestoneEventsOutput struct {
	toolutil.HintableOutput
	Events     []MilestoneEventOutput    `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListMilestoneEventsOutput wraps a list of milestone events.

func ListIssueMilestoneEvents

func ListIssueMilestoneEvents(ctx context.Context, client *gitlabclient.Client, input ListIssueMilestoneEventsInput) (ListMilestoneEventsOutput, error)

ListIssueMilestoneEvents lists milestone events for an issue.

func ListMRMilestoneEvents

func ListMRMilestoneEvents(ctx context.Context, client *gitlabclient.Client, input ListMRMilestoneEventsInput) (ListMilestoneEventsOutput, error)

ListMRMilestoneEvents lists milestone events for a merge request.

type ListStateEventsOutput

type ListStateEventsOutput struct {
	toolutil.HintableOutput
	Events     []StateEventOutput        `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListStateEventsOutput wraps a list of state events.

func ListIssueStateEvents

func ListIssueStateEvents(ctx context.Context, client *gitlabclient.Client, input ListIssueStateEventsInput) (ListStateEventsOutput, error)

ListIssueStateEvents lists state events for an issue.

func ListMRStateEvents

func ListMRStateEvents(ctx context.Context, client *gitlabclient.Client, input ListMRStateEventsInput) (ListStateEventsOutput, error)

ListMRStateEvents lists state events for a merge request.

type ListWeightEventsOutput

type ListWeightEventsOutput struct {
	toolutil.HintableOutput
	Events     []WeightEventOutput       `json:"events"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListWeightEventsOutput wraps a list of weight events.

func ListIssueWeightEvents

func ListIssueWeightEvents(ctx context.Context, client *gitlabclient.Client, input ListIssueWeightEventsInput) (ListWeightEventsOutput, error)

ListIssueWeightEvents lists weight events for an issue.

type MilestoneEventOutput

type MilestoneEventOutput struct {
	toolutil.HintableOutput
	ID             int64  `json:"id"`
	Action         string `json:"action"`
	CreatedAt      string `json:"created_at"`
	ResourceType   string `json:"resource_type"`
	ResourceID     int64  `json:"resource_id"`
	UserID         int64  `json:"user_id"`
	Username       string `json:"username"`
	MilestoneID    int64  `json:"milestone_id"`
	MilestoneTitle string `json:"milestone_title"`
}

MilestoneEventOutput represents a resource milestone event.

func GetIssueMilestoneEvent

func GetIssueMilestoneEvent(ctx context.Context, client *gitlabclient.Client, input GetIssueMilestoneEventInput) (MilestoneEventOutput, error)

GetIssueMilestoneEvent gets a single milestone event for an issue.

func GetMRMilestoneEvent

func GetMRMilestoneEvent(ctx context.Context, client *gitlabclient.Client, input GetMRMilestoneEventInput) (MilestoneEventOutput, error)

GetMRMilestoneEvent gets a single milestone event for a merge request.

type StateEventOutput

type StateEventOutput struct {
	toolutil.HintableOutput
	ID           int64  `json:"id"`
	State        string `json:"state"`
	CreatedAt    string `json:"created_at"`
	ResourceType string `json:"resource_type"`
	ResourceID   int64  `json:"resource_id"`
	UserID       int64  `json:"user_id"`
	Username     string `json:"username"`
}

StateEventOutput represents a resource state event.

func GetIssueStateEvent

func GetIssueStateEvent(ctx context.Context, client *gitlabclient.Client, input GetIssueStateEventInput) (StateEventOutput, error)

GetIssueStateEvent gets a single state event for an issue.

func GetMRStateEvent

func GetMRStateEvent(ctx context.Context, client *gitlabclient.Client, input GetMRStateEventInput) (StateEventOutput, error)

GetMRStateEvent gets a single state event for a merge request.

type WeightEventOutput

type WeightEventOutput struct {
	ID           int64  `json:"id"`
	CreatedAt    string `json:"created_at"`
	ResourceType string `json:"resource_type"`
	ResourceID   int64  `json:"resource_id"`
	State        string `json:"state"`
	IssueID      int64  `json:"issue_id"`
	Weight       int64  `json:"weight"`
	UserID       int64  `json:"user_id"`
	Username     string `json:"username"`
}

WeightEventOutput represents a resource weight event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL