Help us shape the future of Go! Take the 2026 Go Developer Survey

clusteragents

package
v2.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package clusteragents implements MCP tools for GitLab Kubernetes cluster agent operations.

The package wraps the GitLab Cluster agents API:

Index

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 cluster agent tools.

func DeleteAgent

func DeleteAgent(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) error

DeleteAgent deletes agent for the clusteragents package.

func DeleteAgentOutput

func DeleteAgentOutput(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) (toolutil.DeleteOutput, error)

DeleteAgentOutput deletes a cluster agent and returns the canonical success message shape.

func FormatAgentMarkdown

func FormatAgentMarkdown(a AgentItem) string

FormatAgentMarkdown renders a single cluster agent summary.

func FormatAgentsListMarkdown

func FormatAgentsListMarkdown(out ListAgentsOutput) string

FormatAgentsListMarkdown renders cluster agents as a compact Markdown table.

func FormatTokenMarkdown

func FormatTokenMarkdown(t AgentTokenItem) string

FormatTokenMarkdown renders a single cluster agent token summary.

func FormatTokensListMarkdown

func FormatTokensListMarkdown(out ListAgentTokensOutput) string

FormatTokensListMarkdown renders cluster agent tokens as a compact Markdown table.

func RevokeAgentToken

func RevokeAgentToken(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) error

RevokeAgentToken revokes agent token for the clusteragents package.

func RevokeAgentTokenOutput

func RevokeAgentTokenOutput(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) (toolutil.DeleteOutput, error)

RevokeAgentTokenOutput revokes a cluster agent token and returns the canonical success message shape.

Types

type AgentItem

type AgentItem struct {
	toolutil.HintableOutput
	ID              int64               `json:"id"`
	Name            string              `json:"name"`
	CreatedAt       string              `json:"created_at,omitempty"`
	CreatedByUserID int64               `json:"created_by_user_id,omitempty"`
	ConfigProject   ConfigProjectOutput `json:"config_project"`
}

AgentItem holds agent item data for the clusteragents package. It mirrors gl.Agent field-for-field, including the nested config_project reference.

func GetAgent

func GetAgent(ctx context.Context, client *gitlabclient.Client, input GetAgentInput) (AgentItem, error)

GetAgent retrieves agent for the clusteragents package.

func RegisterAgent

func RegisterAgent(ctx context.Context, client *gitlabclient.Client, input RegisterAgentInput) (AgentItem, error)

RegisterAgent coordinates register agent for the clusteragents package.

type AgentTokenItem

type AgentTokenItem struct {
	toolutil.HintableOutput
	ID              int64  `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description,omitempty"`
	AgentID         int64  `json:"agent_id"`
	Status          string `json:"status"`
	CreatedAt       string `json:"created_at,omitempty"`
	CreatedByUserID int64  `json:"created_by_user_id,omitempty"`
	LastUsedAt      string `json:"last_used_at,omitempty"`
	Token           string `json:"token,omitempty"`
}

AgentTokenItem holds agent token item data for the clusteragents package. It mirrors gl.AgentToken field-for-field.

func CreateAgentToken

func CreateAgentToken(ctx context.Context, client *gitlabclient.Client, input CreateAgentTokenInput) (AgentTokenItem, error)

CreateAgentToken creates agent token for the clusteragents package.

func GetAgentToken

func GetAgentToken(ctx context.Context, client *gitlabclient.Client, input GetAgentTokenInput) (AgentTokenItem, error)

GetAgentToken retrieves agent token for the clusteragents package.

type ConfigProjectOutput added in v2.3.0

type ConfigProjectOutput struct {
	ID                int64  `json:"id"`
	Description       string `json:"description,omitempty"`
	Name              string `json:"name"`
	NameWithNamespace string `json:"name_with_namespace,omitempty"`
	Path              string `json:"path,omitempty"`
	PathWithNamespace string `json:"path_with_namespace,omitempty"`
	CreatedAt         string `json:"created_at,omitempty"`
}

ConfigProjectOutput mirrors gl.ConfigProject (a cluster agent's configuration project reference) field-for-field.

type CreateAgentTokenInput

type CreateAgentTokenInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID     int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	Name        string               `json:"name" jsonschema:"Token name,required"`
	Description string               `json:"description" jsonschema:"Token description"`
}

CreateAgentTokenInput defines parameters for the create agent token operation.

type DeleteAgentInput

type DeleteAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
}

DeleteAgentInput defines parameters for the delete agent operation.

type GetAgentInput

type GetAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
}

GetAgentInput defines parameters for the get agent operation.

type GetAgentTokenInput

type GetAgentTokenInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	TokenID   int64                `json:"token_id" jsonschema:"Token ID,required"`
}

GetAgentTokenInput defines parameters for the get agent token operation.

type ListAgentTokensInput

type ListAgentTokensInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
	OrderBy string `` /* 129-byte string literal not displayed */
	Sort    string `json:"sort,omitempty" jsonschema:"Sort direction for keyset pagination: asc or desc."`
}

ListAgentTokensInput defines parameters for the list agent tokens operation.

type ListAgentTokensOutput

type ListAgentTokensOutput struct {
	toolutil.HintableOutput
	Tokens     []AgentTokenItem          `json:"tokens"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListAgentTokensOutput represents the response from the list agent tokens operation.

func ListAgentTokens

func ListAgentTokens(ctx context.Context, client *gitlabclient.Client, input ListAgentTokensInput) (ListAgentTokensOutput, error)

ListAgentTokens lists agent tokens for the clusteragents package.

type ListAgentsInput

type ListAgentsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
	OrderBy string `` /* 129-byte string literal not displayed */
	Sort    string `json:"sort,omitempty" jsonschema:"Sort direction for keyset pagination: asc or desc."`
}

ListAgentsInput defines parameters for the list agents operation.

type ListAgentsOutput

type ListAgentsOutput struct {
	toolutil.HintableOutput
	Agents     []AgentItem               `json:"agents"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListAgentsOutput represents the response from the list agents operation.

func ListAgents

func ListAgents(ctx context.Context, client *gitlabclient.Client, input ListAgentsInput) (ListAgentsOutput, error)

ListAgents lists agents for the clusteragents package.

type RegisterAgentInput

type RegisterAgentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Name      string               `json:"name" jsonschema:"Agent name,required"`
}

RegisterAgentInput defines parameters for the register agent operation.

type RevokeAgentTokenInput

type RevokeAgentTokenInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	AgentID   int64                `json:"agent_id" jsonschema:"Agent ID,required"`
	TokenID   int64                `json:"token_id" jsonschema:"Token ID,required"`
}

RevokeAgentTokenInput defines parameters for the revoke agent token operation.

Jump to

Keyboard shortcuts

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