Documentation
¶
Overview ¶
Package clusteragents implements MCP tools for GitLab Kubernetes cluster agents.
markdown.go provides Markdown formatting functions for cluster agent MCP tool output.
register.go wires clusteragents MCP tools to the MCP server.
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 RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- func RevokeAgentToken(ctx context.Context, client *gitlabclient.Client, input RevokeAgentTokenInput) error
- type AgentItem
- type AgentTokenItem
- 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 performs the format agent markdown operation for the clusteragents package.
func FormatAgentsListMarkdown ¶
func FormatAgentsListMarkdown(out ListAgentsOutput) string
FormatAgentsListMarkdown performs the format agents list markdown operation for the clusteragents package.
func FormatTokenMarkdown ¶
func FormatTokenMarkdown(t AgentTokenItem) string
FormatTokenMarkdown performs the format token markdown operation for the clusteragents package.
func FormatTokensListMarkdown ¶
func FormatTokensListMarkdown(out ListAgentTokensOutput) string
FormatTokensListMarkdown performs the format tokens list markdown operation for the clusteragents package.
func RegisterMeta ¶
func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
RegisterMeta registers the gitlab_cluster_agent meta-tool.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all cluster agent tools with the MCP server.
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"`
CreatedByUserID int64 `json:"created_by_user_id,omitempty"`
}
AgentItem holds data for clusteragents operations.
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 performs the register agent operation 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"`
Token string `json:"token,omitempty"`
}
AgentTokenItem holds data for clusteragents operations.
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 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"`
Page int64 `json:"page" jsonschema:"Page number for pagination"`
PerPage int64 `json:"per_page" jsonschema:"Number of items per page"`
}
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"`
Page int64 `json:"page" jsonschema:"Page number for pagination"`
PerPage int64 `json:"per_page" jsonschema:"Number of items per page"`
}
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.