runnercontrollertokens

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

markdown.go provides Markdown formatting functions for runner controller token MCP tool output.

register.go wires runner controller token MCP tools to the MCP server.

Package runnercontrollertokens implements MCP tool handlers for GitLab Runner Controller Tokens. This is an admin-only API. Experimental: may change or be removed in future versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatGetMarkdown

func FormatGetMarkdown(out Output) *mcp.CallToolResult

FormatGetMarkdown formats Get output as an MCP tool result.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a list of runner controller tokens as Markdown.

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output) string

FormatOutputMarkdown renders a runner controller token as Markdown.

func RegisterMeta

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

RegisterMeta registers the gitlab_runner_controller_token meta-tool.

func RegisterTools

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

RegisterTools registers all runner controller token tools on the MCP server.

func Revoke

func Revoke(ctx context.Context, client *gitlabclient.Client, input RevokeInput) error

Revoke revokes a runner controller token (admin only).

Types

type CreateInput

type CreateInput struct {
	ControllerID int64  `json:"controller_id" jsonschema:"Runner controller ID,required"`
	Description  string `json:"description,omitempty" jsonschema:"Description of the token"`
}

CreateInput defines parameters for creating a runner controller token.

type GetInput

type GetInput struct {
	ControllerID int64 `json:"controller_id" jsonschema:"Runner controller ID,required"`
	TokenID      int64 `json:"token_id" jsonschema:"Token ID,required"`
}

GetInput defines parameters for getting a runner controller token.

type ListInput

type ListInput struct {
	ControllerID int64 `json:"controller_id" jsonschema:"Runner controller ID,required"`
	toolutil.PaginationInput
}

ListInput defines parameters for listing runner controller tokens.

type ListOutput

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

ListOutput holds a paginated list of runner controller tokens.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List retrieves all tokens for a runner controller (admin only).

type Output

type Output struct {
	toolutil.HintableOutput
	ID                 int64  `json:"id"`
	RunnerControllerID int64  `json:"runner_controller_id"`
	Description        string `json:"description"`
	Token              string `json:"token,omitempty"`
	LastUsedAt         string `json:"last_used_at,omitempty"`
	CreatedAt          string `json:"created_at,omitempty"`
	UpdatedAt          string `json:"updated_at,omitempty"`
}

Output represents a runner controller token in responses.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)

Create creates a new runner controller token (admin only).

func Get

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

Get retrieves a single runner controller token (admin only).

func Rotate

func Rotate(ctx context.Context, client *gitlabclient.Client, input RotateInput) (Output, error)

Rotate rotates a runner controller token (admin only).

type RevokeInput

type RevokeInput struct {
	ControllerID int64 `json:"controller_id" jsonschema:"Runner controller ID,required"`
	TokenID      int64 `json:"token_id" jsonschema:"Token ID,required"`
}

RevokeInput defines parameters for revoking a runner controller token.

type RotateInput

type RotateInput struct {
	ControllerID int64 `json:"controller_id" jsonschema:"Runner controller ID,required"`
	TokenID      int64 `json:"token_id" jsonschema:"Token ID,required"`
}

RotateInput defines parameters for rotating a runner controller token.

Jump to

Keyboard shortcuts

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