Documentation
¶
Overview ¶
Package features implements MCP tools for GitLab Features (feature flags) API.
markdown.go provides Markdown formatting functions for GitLab feature MCP tool output.
register.go wires features MCP tools to the MCP server.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatFeatureMarkdown(output SetOutput) *mcp.CallToolResult
- func FormatListDefinitionsMarkdown(output ListDefinitionsOutput) *mcp.CallToolResult
- func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type DefinitionItem
- type DeleteInput
- type FeatureItem
- type GateItem
- type ListDefinitionsInput
- type ListDefinitionsOutput
- type ListInput
- type ListOutput
- type SetInput
- type SetOutput
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 feature flag.
func FormatFeatureMarkdown ¶
func FormatFeatureMarkdown(output SetOutput) *mcp.CallToolResult
FormatFeatureMarkdown formats a single feature as markdown.
func FormatListDefinitionsMarkdown ¶
func FormatListDefinitionsMarkdown(output ListDefinitionsOutput) *mcp.CallToolResult
FormatListDefinitionsMarkdown formats a list of feature definitions as markdown.
func FormatListMarkdown ¶
func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
FormatListMarkdown formats a list of features as markdown.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all feature flag tools on the MCP server.
Types ¶
type DefinitionItem ¶
type DefinitionItem struct {
Name string `json:"name"`
IntroducedByURL string `json:"introduced_by_url,omitempty"`
RolloutIssueURL string `json:"rollout_issue_url,omitempty"`
Milestone string `json:"milestone,omitempty"`
LogStateChanges bool `json:"log_state_changes"`
Type string `json:"type,omitempty"`
Group string `json:"group,omitempty"`
DefaultEnabled bool `json:"default_enabled"`
}
DefinitionItem represents a feature definition.
type DeleteInput ¶
type DeleteInput struct {
Name string `json:"name" jsonschema:"Feature flag name to delete,required"`
}
DeleteInput is the input for deleting a feature flag.
type FeatureItem ¶
type FeatureItem struct {
Name string `json:"name"`
State string `json:"state"`
Gates []GateItem `json:"gates,omitempty"`
Definition *DefinitionItem `json:"definition,omitempty"`
}
FeatureItem represents a feature flag.
type ListDefinitionsInput ¶
type ListDefinitionsInput struct{}
ListDefinitionsInput is the input for listing feature definitions.
type ListDefinitionsOutput ¶
type ListDefinitionsOutput struct {
toolutil.HintableOutput
Definitions []DefinitionItem `json:"definitions"`
}
ListDefinitionsOutput is the output for listing feature definitions.
func ListDefinitions ¶
func ListDefinitions(ctx context.Context, client *gitlabclient.Client, _ ListDefinitionsInput) (ListDefinitionsOutput, error)
ListDefinitions retrieves all feature definitions.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Features []FeatureItem `json:"features"`
}
ListOutput is the output for listing features.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, _ ListInput) (ListOutput, error)
List retrieves all feature flags.
type SetInput ¶
type SetInput struct {
Name string `json:"name" jsonschema:"Feature flag name,required"`
Value any `json:"value" jsonschema:"Value to set (true, false, integer percentage, or string),required"`
Key string `json:"key,omitempty" jsonschema:"Gate key (percentage_of_actors or percentage_of_time)"`
FeatureGroup string `json:"feature_group,omitempty" jsonschema:"Feature group name"`
User string `json:"user,omitempty" jsonschema:"GitLab username"`
Group string `json:"group,omitempty" jsonschema:"GitLab group path"`
Namespace string `json:"namespace,omitempty" jsonschema:"GitLab namespace path"`
Project string `json:"project,omitempty" jsonschema:"GitLab project path (namespace/project)"`
Repository string `json:"repository,omitempty" jsonschema:"GitLab repository path"`
Force bool `json:"force,omitempty" jsonschema:"Force the change even if the flag is read-only"`
}
SetInput is the input for setting a feature flag.
type SetOutput ¶
type SetOutput struct {
toolutil.HintableOutput
Feature FeatureItem `json:"feature"`
}
SetOutput is the output for setting a feature flag.