Documentation
¶
Overview ¶
Package integrations implements MCP tools for GitLab project and group integrations.
It wraps the GitLab Services service from client-go v2. The generic tools list, get, and delete project-level integrations by slug, while integration-specific tools handle configuration details such as Jira and group-level Datadog settings. The package also provides Markdown rendering for project and group integration responses.
The package wraps two GitLab API surfaces:
- Project integrations: https://docs.gitlab.com/api/integrations/
- Group integrations: https://docs.gitlab.com/api/group_integrations/
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func DeleteGroupDatadog(ctx context.Context, client *gitlabclient.Client, ...) error
- func FormatGetGroupDatadogMarkdown(out GetGroupDatadogOutput) *mcp.CallToolResult
- func FormatGetMarkdown(out GetOutput) *mcp.CallToolResult
- func FormatListMarkdown(out ListOutput) *mcp.CallToolResult
- func FormatSetGroupDatadogMarkdown(out SetGroupDatadogOutput) *mcp.CallToolResult
- type DeleteGroupDatadogInput
- type DeleteInput
- type GetGroupDatadogInput
- type GetGroupDatadogOutput
- type GetInput
- type GetOutput
- type GroupDatadogItem
- type IntegrationItem
- type ListInput
- type ListOutput
- type SetGroupDatadogInput
- type SetGroupDatadogOutput
- type SetJiraInput
- type SetJiraOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
ActionSpecs returns canonical specs for project integration actions.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes/disables a specific integration from a project.
func DeleteGroupDatadog ¶ added in v2.2.0
func DeleteGroupDatadog(ctx context.Context, client *gitlabclient.Client, input DeleteGroupDatadogInput) error
DeleteGroupDatadog removes the Datadog integration configuration from a group. Requires Owner role on the group; deletion is irreversible and clears the stored API key.
func FormatGetGroupDatadogMarkdown ¶ added in v2.2.0
func FormatGetGroupDatadogMarkdown(out GetGroupDatadogOutput) *mcp.CallToolResult
FormatGetGroupDatadogMarkdown renders the read output for the group-level Datadog integration.
func FormatGetMarkdown ¶
func FormatGetMarkdown(out GetOutput) *mcp.CallToolResult
FormatGetMarkdown formats a single integration.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) *mcp.CallToolResult
FormatListMarkdown formats a list of integrations.
func FormatSetGroupDatadogMarkdown ¶ added in v2.2.0
func FormatSetGroupDatadogMarkdown(out SetGroupDatadogOutput) *mcp.CallToolResult
FormatSetGroupDatadogMarkdown renders the mutate output for the group-level Datadog integration.
Types ¶
type DeleteGroupDatadogInput ¶ added in v2.2.0
type DeleteGroupDatadogInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
DeleteGroupDatadogInput is the input for removing the Datadog integration from a group.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Slug string `` /* 307-byte string literal not displayed */
}
DeleteInput is the input for deleting/disabling an integration.
type GetGroupDatadogInput ¶ added in v2.2.0
type GetGroupDatadogInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}
GetGroupDatadogInput is the input for fetching the Datadog integration of a group.
type GetGroupDatadogOutput ¶ added in v2.2.0
type GetGroupDatadogOutput struct {
toolutil.HintableOutput
Integration GroupDatadogItem `json:"integration"`
}
GetGroupDatadogOutput is the output of GetGroupDatadog.
func GetGroupDatadog ¶ added in v2.2.0
func GetGroupDatadog(ctx context.Context, client *gitlabclient.Client, input GetGroupDatadogInput) (GetGroupDatadogOutput, error)
GetGroupDatadog retrieves the Datadog integration configured for a group. Requires Owner role and GitLab Premium/Ultimate (self-managed EE or GitLab.com).
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Slug string `` /* 307-byte string literal not displayed */
}
GetInput is the input for getting an integration by slug.
type GetOutput ¶
type GetOutput struct {
toolutil.HintableOutput
Integration IntegrationItem `json:"integration"`
}
GetOutput is the output for a single integration.
type GroupDatadogItem ¶ added in v2.2.0
type GroupDatadogItem struct {
ID int64 `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
Active bool `json:"active"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
APIURL string `json:"api_url,omitempty"`
DatadogEnv string `json:"datadog_env,omitempty"`
DatadogService string `json:"datadog_service,omitempty"`
DatadogSite string `json:"datadog_site,omitempty"`
DatadogTags string `json:"datadog_tags,omitempty"`
ArchiveTraceEvents *bool `json:"archive_trace_events,omitempty"`
}
GroupDatadogItem is a JSON-serializable view of gl.GroupDatadogIntegration returned by the group-level Datadog integration tools. The struct flattens the embedded gl.Integration fields and the Datadog-specific fields so the LLM-facing schema stays stable even when client-go adds new embedded types.
type IntegrationItem ¶
type IntegrationItem struct {
ID int64 `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
Active bool `json:"active"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
IntegrationItem is a summary of an integration/service.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
ListInput is the input for listing project integrations.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Integrations []IntegrationItem `json:"integrations"`
}
ListOutput is the output for listing integrations.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List returns all integrations for a project.
type SetGroupDatadogInput ¶ added in v2.2.0
type SetGroupDatadogInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
APIKey string `json:"api_key,omitempty" jsonschema:"Datadog API key (write-only; never returned by the get endpoint)"`
APIURL string `json:"api_url,omitempty" jsonschema:"Datadog API URL (e.g. https://api.datadoghq.com)"`
DatadogEnv string `json:"datadog_env,omitempty" jsonschema:"Datadog env tag forwarded with every log/metric"`
DatadogService string `json:"datadog_service,omitempty" jsonschema:"Datadog service tag forwarded with every log/metric"`
DatadogSite string `` /* 147-byte string literal not displayed */
DatadogTags string `json:"datadog_tags,omitempty" jsonschema:"Comma-separated Datadog tags forwarded with every log/metric"`
ArchiveTraceEvents *bool `json:"archive_trace_events,omitempty" jsonschema:"Forward CI job trace events to Datadog"`
UseInheritedSettings *bool `` /* 177-byte string literal not displayed */
}
SetGroupDatadogInput is the input for creating or updating the Datadog integration of a group. At least one Datadog field must be set, or UseInheritedSettings=true to inherit settings from an ancestor group.
type SetGroupDatadogOutput ¶ added in v2.2.0
type SetGroupDatadogOutput struct {
toolutil.HintableOutput
Integration GroupDatadogItem `json:"integration"`
}
SetGroupDatadogOutput is the output of SetGroupDatadog.
func SetGroupDatadog ¶ added in v2.2.0
func SetGroupDatadog(ctx context.Context, client *gitlabclient.Client, input SetGroupDatadogInput) (SetGroupDatadogOutput, error)
SetGroupDatadog creates or updates the Datadog integration for a group. Requires Owner role and GitLab Premium/Ultimate (self-managed EE or GitLab.com).
type SetJiraInput ¶
type SetJiraInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
URL string `json:"url" jsonschema:"Jira instance base URL,required"`
Username string `json:"username,omitempty" jsonschema:"Jira username"`
Password string `json:"password,omitempty" jsonschema:"Jira password or API token"`
Active *bool `json:"active,omitempty" jsonschema:"Enable or disable the integration"`
APIURL string `json:"api_url,omitempty" jsonschema:"Jira API URL (overrides base URL)"`
JiraAuthType *int64 `json:"jira_auth_type,omitempty" jsonschema:"Jira auth type (0=basic, 1=token)"`
JiraIssuePrefix string `json:"jira_issue_prefix,omitempty" jsonschema:"Jira issue key prefix"`
JiraIssueRegex string `json:"jira_issue_regex,omitempty" jsonschema:"Custom regex for Jira issue keys"`
JiraIssueTransitionAutomatic *bool `json:"jira_issue_transition_automatic,omitempty" jsonschema:"Auto-transition Jira issues"`
JiraIssueTransitionID string `json:"jira_issue_transition_id,omitempty" jsonschema:"Jira transition ID"`
CommitEvents *bool `json:"commit_events,omitempty" jsonschema:"Trigger on commit events"`
MergeRequestsEvents *bool `json:"merge_requests_events,omitempty" jsonschema:"Trigger on merge request events"`
CommentOnEventEnabled *bool `json:"comment_on_event_enabled,omitempty" jsonschema:"Add comments on Jira issues for events"`
IssuesEnabled *bool `json:"issues_enabled,omitempty" jsonschema:"Enable Jira issues integration"`
ProjectKeys []string `json:"project_keys,omitempty" jsonschema:"Jira project keys to restrict"`
UseInheritedSettings *bool `json:"use_inherited_settings,omitempty" jsonschema:"Use inherited settings from group"`
}
SetJiraInput is the input for configuring the Jira integration.
type SetJiraOutput ¶
type SetJiraOutput struct {
toolutil.HintableOutput
Integration IntegrationItem `json:"integration"`
}
SetJiraOutput is the output after configuring Jira.
func SetJira ¶
func SetJira(ctx context.Context, client *gitlabclient.Client, input SetJiraInput) (SetJiraOutput, error)
SetJira configures the Jira integration for a project.