Documentation
¶
Overview ¶
Package clusteragents implements MCP tools for GitLab Kubernetes cluster agent operations.
The package wraps the GitLab Cluster agents API:
Index ¶
- func DeleteAgent(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) error
- func FormatAgentMarkdown(a AgentItem) string
- func FormatAgentsListMarkdown(out ListAgentsOutput) string
- func FormatTokenMarkdown(t AgentTokenItem) string
- func FormatTokensListMarkdown(out ListAgentTokensOutput) string
- func RevokeAgentToken(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) error
- type AgentItem
- type AgentTokenItem
- type ConfigProjectOutput
- type CreateAgentTokenInput
- type DeleteAgentInput
- type GetAgentInput
- type GetAgentTokenInput
- type ListAgentTokensInput
- type ListAgentTokensOutput
- type ListAgentsInput
- type ListAgentsOutput
- type RegisterAgentInput
- type RevokeAgentTokenInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAgent ¶
func DeleteAgent(ctx context.Context, client *gitlabclient.Client, input DeleteAgentInput) error
DeleteAgent deletes agent for the clusteragents package.
func FormatAgentMarkdown ¶
FormatAgentMarkdown renders a single cluster agent as the card of one object.
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 as the card of one object.
The secret is a code span written by the card rather than a fence of the formatter's own: the value has to be copied back verbatim, and a hand-written fence is closed by the first backtick run the value happens to contain. toolutil.Card.Secret also supplies the "store it securely" hint, so the sentence is written once, where it also reaches next_steps.
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.
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"`
IsReceptive bool `json:"is_receptive"`
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 ¶
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.