Documentation
¶
Overview ¶
action_specs.go holds what this package contributes to the canonical action catalog. The specs themselves are declared in internal/tools/adminspecs, which is the one place the gitlab_admin group is assembled; what stays here is the handler adaptation a spec routes to.
This package used to declare a full set of specs of its own that nothing ever aggregated, so they reached no surface and no validation.
Package customattributes implements MCP tools for GitLab custom attribute operations.
The package wraps the GitLab Custom attributes API:
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func DeleteOutput(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (toolutil.DeleteOutput, error)
- func FormatGetMarkdown(out GetOutput) string
- func FormatListMarkdown(out ListOutput) string
- func FormatSetMarkdown(out SetOutput) string
- type AttributeItem
- type DeleteInput
- type GetInput
- type GetOutput
- 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 deletes a custom attribute (admin).
func DeleteOutput ¶
func DeleteOutput(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (toolutil.DeleteOutput, error)
DeleteOutput deletes a custom attribute and returns the canonical success message shape.
func FormatGetMarkdown ¶
FormatGetMarkdown renders one custom attribute as a card. The two values used to be written as bullet-less "**Key**: …" lines, which a Markdown reader runs together into one paragraph, and neither was escaped.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders custom attributes as the collection they are: one table row per key and value, with both escaped, since an attribute is written by whoever administers the instance and its key is as free-form as its value.
func FormatSetMarkdown ¶
FormatSetMarkdown renders the attribute the set action wrote: a set returns the object, so it is the same card its get counterpart renders.
Types ¶
type AttributeItem ¶
AttributeItem represents a single custom attribute.
type DeleteInput ¶
type DeleteInput struct {
ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
ResourceID int64 `json:"resource_id" jsonschema:"ID of the resource,required"`
Key string `json:"key" jsonschema:"Attribute key to delete,required"`
}
DeleteInput is the input for deleting a custom attribute.
type GetInput ¶
type GetInput struct {
ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
ResourceID int64 `json:"resource_id" jsonschema:"ID of the resource,required"`
Key string `json:"key" jsonschema:"Attribute key,required"`
}
GetInput is the input for getting a custom attribute.
type GetOutput ¶
type GetOutput struct {
toolutil.HintableOutput
AttributeItem
}
GetOutput is the output for getting a custom attribute.
type ListInput ¶
type ListInput struct {
ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
ResourceID int64 `json:"resource_id" jsonschema:"ID of the resource,required"`
}
ListInput is the input for listing custom attributes.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Attributes []AttributeItem `json:"attributes"`
}
ListOutput is the output for listing custom attributes.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List lists custom attributes for a resource (admin).
type SetInput ¶
type SetInput struct {
ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
ResourceID int64 `json:"resource_id" jsonschema:"ID of the resource,required"`
Key string `json:"key" jsonschema:"Attribute key,required"`
Value string `json:"value" jsonschema:"Attribute value,required"`
}
SetInput is the input for setting a custom attribute.
type SetOutput ¶
type SetOutput struct {
toolutil.HintableOutput
AttributeItem
}
SetOutput is the output for setting a custom attribute.