Documentation
¶
Overview ¶
Package systemhooks implements MCP tools for GitLab System Hooks API.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatHookMarkdown(item HookItem) *mcp.CallToolResult
- func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
- func FormatTestMarkdown(output TestOutput) *mcp.CallToolResult
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type AddInput
- type AddOutput
- type DeleteInput
- type GetInput
- type GetOutput
- type HookEventItem
- type HookItem
- type ListInput
- type ListOutput
- type TestInput
- type TestOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes a system hook.
func FormatHookMarkdown ¶
func FormatHookMarkdown(item HookItem) *mcp.CallToolResult
FormatHookMarkdown formats a single system hook.
func FormatListMarkdown ¶
func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
FormatListMarkdown formats a list of system hooks.
func FormatTestMarkdown ¶
func FormatTestMarkdown(output TestOutput) *mcp.CallToolResult
FormatTestMarkdown formats a hook test event result.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all system hooks tools on the MCP server.
Types ¶
type AddInput ¶
type AddInput struct {
URL string `json:"url" jsonschema:"Hook URL to receive events,required"`
Name string `json:"name,omitempty" jsonschema:"Descriptive name for the hook"`
Description string `json:"description,omitempty" jsonschema:"Description for the hook"`
Token string `json:"token,omitempty" jsonschema:"Secret token for payload validation"`
PushEvents *bool `json:"push_events,omitempty" jsonschema:"Trigger on push events"`
PushEventsBranchFilter string `json:"push_events_branch_filter,omitempty" jsonschema:"Branch filter for push events (wildcard, regex, or branch name)"`
BranchFilterStrategy string `json:"branch_filter_strategy,omitempty" jsonschema:"Branch filter strategy: wildcard, regex, or all_branches"`
TagPushEvents *bool `json:"tag_push_events,omitempty" jsonschema:"Trigger on tag push events"`
MergeRequestsEvents *bool `json:"merge_requests_events,omitempty" jsonschema:"Trigger on merge request events"`
RepositoryUpdateEvents *bool `json:"repository_update_events,omitempty" jsonschema:"Trigger on repository update events"`
EnableSSLVerification *bool `json:"enable_ssl_verification,omitempty" jsonschema:"Enable SSL verification for the hook URL"`
}
AddInput is the input for adding a system hook.
type AddOutput ¶
type AddOutput struct {
toolutil.HintableOutput
Hook HookItem `json:"hook"`
}
AddOutput wraps the added hook.
type DeleteInput ¶
type DeleteInput struct {
ID int64 `json:"id" jsonschema:"System hook ID to delete,required"`
}
DeleteInput is the input for deleting a system hook.
type GetInput ¶
type GetInput struct {
ID int64 `json:"id" jsonschema:"System hook ID,required"`
}
GetInput is the input for getting a system hook.
type GetOutput ¶
type GetOutput struct {
toolutil.HintableOutput
Hook HookItem `json:"hook"`
}
GetOutput wraps a single hook.
type HookEventItem ¶
type HookEventItem struct {
EventName string `json:"event_name"`
Name string `json:"name"`
Path string `json:"path"`
ProjectID int64 `json:"project_id"`
OwnerName string `json:"owner_name"`
OwnerEmail string `json:"owner_email"`
}
HookEventItem represents a hook test event.
type HookItem ¶
type HookItem struct {
ID int64 `json:"id"`
URL string `json:"url"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
PushEvents bool `json:"push_events"`
TagPushEvents bool `json:"tag_push_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
RepositoryUpdateEvents bool `json:"repository_update_events"`
EnableSSLVerification bool `json:"enable_ssl_verification"`
}
HookItem represents a system hook.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Hooks []HookItem `json:"hooks"`
}
ListOutput contains the list of system hooks.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, _ ListInput) (ListOutput, error)
List retrieves all system hooks.
type TestInput ¶
type TestInput struct {
ID int64 `json:"id" jsonschema:"System hook ID to test,required"`
}
TestInput is the input for testing a system hook.
type TestOutput ¶
type TestOutput struct {
toolutil.HintableOutput
Event HookEventItem `json:"event"`
}
TestOutput wraps the test event result.
func Test ¶
func Test(ctx context.Context, client *gitlabclient.Client, input TestInput) (TestOutput, error)
Test triggers a test event for a system hook.