customattributes

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package customattributes implements MCP tools for GitLab Custom Attributes API.

Index

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 FormatGetMarkdown

func FormatGetMarkdown(out GetOutput) string

FormatGetMarkdown formats a single custom attribute as markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats custom attributes list as markdown.

func FormatSetMarkdown

func FormatSetMarkdown(out SetOutput) string

FormatSetMarkdown formats a set custom attribute result as markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all Custom Attributes MCP tools.

Types

type AttributeItem

type AttributeItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

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.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (GetOutput, error)

Get gets a single custom attribute by key (admin).

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.

func Set

func Set(ctx context.Context, client *gitlabclient.Client, input SetInput) (SetOutput, error)

Set sets (creates or updates) a custom attribute (admin).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL