Documentation
¶
Overview ¶
Package events implements MCP tools for GitLab event operations including listing project visible events and user contribution events.
markdown.go provides Markdown formatting functions for event MCP tool output.
register.go wires events MCP tools to the MCP server.
Index ¶
- func FormatContributionListMarkdown(out ListContributionEventsOutput) *mcp.CallToolResult
- func FormatContributionListMarkdownString(out ListContributionEventsOutput) string
- func FormatListMarkdown(out ListProjectEventsOutput) *mcp.CallToolResult
- func FormatListMarkdownString(out ListProjectEventsOutput) string
- func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type ContributionEventOutput
- type ListContributionEventsInput
- type ListContributionEventsOutput
- type ListProjectEventsInput
- type ListProjectEventsOutput
- type ProjectEventOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatContributionListMarkdown ¶
func FormatContributionListMarkdown(out ListContributionEventsOutput) *mcp.CallToolResult
FormatContributionListMarkdown formats contribution events as a Markdown CallToolResult.
func FormatContributionListMarkdownString ¶
func FormatContributionListMarkdownString(out ListContributionEventsOutput) string
FormatContributionListMarkdownString renders contribution events as a Markdown string.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListProjectEventsOutput) *mcp.CallToolResult
FormatListMarkdown formats project events as a Markdown CallToolResult.
func FormatListMarkdownString ¶
func FormatListMarkdownString(out ListProjectEventsOutput) string
FormatListMarkdownString renders project events as a Markdown string.
func RegisterMeta ¶
func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
RegisterMeta registers the gitlab_event meta-tool.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers individual event tools.
Types ¶
type ContributionEventOutput ¶
type ContributionEventOutput struct {
ID int64 `json:"id"`
Title string `json:"title,omitempty"`
ProjectID int64 `json:"project_id"`
ActionName string `json:"action_name"`
TargetID int64 `json:"target_id,omitempty"`
TargetIID int64 `json:"target_iid,omitempty"`
TargetType string `json:"target_type,omitempty"`
TargetURL string `json:"target_url,omitempty"`
AuthorID int64 `json:"author_id"`
TargetTitle string `json:"target_title,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
AuthorUsername string `json:"author_username,omitempty"`
}
ContributionEventOutput represents a single contribution event.
type ListContributionEventsInput ¶
type ListContributionEventsInput struct {
Action string `` /* 156-byte string literal not displayed */
TargetType string `` /* 127-byte string literal not displayed */
Before string `json:"before,omitempty" jsonschema:"Return events before this date (YYYY-MM-DD)"`
After string `json:"after,omitempty" jsonschema:"Return events after this date (YYYY-MM-DD)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort order (asc or desc)"`
Scope string `json:"scope,omitempty" jsonschema:"Include events from all projects (all) or only user's projects"`
Page int64 `json:"page,omitempty" jsonschema:"Page number for pagination (default 1)"`
PerPage int64 `json:"per_page,omitempty" jsonschema:"Number of items per page (default 20, max 100)"`
}
ListContributionEventsInput contains parameters for listing current user contribution events.
type ListContributionEventsOutput ¶
type ListContributionEventsOutput struct {
toolutil.HintableOutput
Events []ContributionEventOutput `json:"events"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListContributionEventsOutput holds a paginated list of contribution events.
func ListCurrentUserContributionEvents ¶
func ListCurrentUserContributionEvents(ctx context.Context, client *gitlabclient.Client, input ListContributionEventsInput) (ListContributionEventsOutput, error)
ListCurrentUserContributionEvents returns contribution events for the authenticated user.
type ListProjectEventsInput ¶
type ListProjectEventsInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Action string `` /* 156-byte string literal not displayed */
TargetType string `` /* 127-byte string literal not displayed */
Before string `json:"before,omitempty" jsonschema:"Return events before this date (YYYY-MM-DD)"`
After string `json:"after,omitempty" jsonschema:"Return events after this date (YYYY-MM-DD)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort order (asc or desc, default desc)"`
Page int64 `json:"page,omitempty" jsonschema:"Page number for pagination (default 1)"`
PerPage int64 `json:"per_page,omitempty" jsonschema:"Number of items per page (default 20, max 100)"`
}
ListProjectEventsInput contains parameters for listing project visible events.
type ListProjectEventsOutput ¶
type ListProjectEventsOutput struct {
toolutil.HintableOutput
Events []ProjectEventOutput `json:"events"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListProjectEventsOutput holds a paginated list of project events.
func ListProjectEvents ¶
func ListProjectEvents(ctx context.Context, client *gitlabclient.Client, input ListProjectEventsInput) (ListProjectEventsOutput, error)
ListProjectEvents returns a paginated list of visible events for a project.
type ProjectEventOutput ¶
type ProjectEventOutput struct {
ID int64 `json:"id"`
Title string `json:"title,omitempty"`
ProjectID int64 `json:"project_id"`
ActionName string `json:"action_name"`
TargetID int64 `json:"target_id,omitempty"`
TargetIID int64 `json:"target_iid,omitempty"`
TargetType string `json:"target_type,omitempty"`
TargetURL string `json:"target_url,omitempty"`
AuthorID int64 `json:"author_id"`
TargetTitle string `json:"target_title,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
AuthorUsername string `json:"author_username,omitempty"`
}
ProjectEventOutput represents a single project event.