cicatalog

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: 9 Imported by: 0

Documentation

Overview

Package cicatalog implements MCP tool handlers for GitLab CI/CD Catalog resource discovery and retrieval using the GraphQL API. The CI/CD Catalog is a GraphQL-only feature with no REST equivalent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatGetMarkdown

func FormatGetMarkdown(out GetOutput) string

FormatGetMarkdown renders a single catalog resource detail as Markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a paginated list of catalog resources as Markdown.

func RegisterTools

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

RegisterTools registers CI/CD Catalog tools on the MCP server.

Types

type ComponentItem

type ComponentItem struct {
	Name        string      `json:"name"`
	Description string      `json:"description,omitempty"`
	IncludePath string      `json:"include_path"`
	Inputs      []InputItem `json:"inputs,omitempty"`
}

ComponentItem represents a single CI/CD component within a catalog resource.

type GetInput

type GetInput struct {
	ID       string `json:"id,omitempty" jsonschema:"Catalog resource GID (e.g. gid://gitlab/Ci::CatalogResource/1). Use either id or full_path."`
	FullPath string `` /* 144-byte string literal not displayed */
}

GetInput is the input for getting a single CI/CD Catalog resource.

type GetOutput

type GetOutput struct {
	toolutil.HintableOutput
	Resource ResourceDetail `json:"resource"`
}

GetOutput is the output for getting a single CI/CD Catalog resource.

func Get

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

Get retrieves a single CI/CD Catalog resource via the GitLab GraphQL API.

type InputItem

type InputItem struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
	Required    bool   `json:"required"`
	Default     string `json:"default,omitempty"`
}

InputItem represents an input parameter for a component.

type ListInput

type ListInput struct {
	Search string `json:"search,omitempty" jsonschema:"Search resources by name or description"`
	Scope  string `json:"scope,omitempty" jsonschema:"Filter scope: ALL (default) or NAMESPACED"`
	Sort   string `` /* 158-byte string literal not displayed */
	toolutil.GraphQLPaginationInput
}

ListInput is the input for listing CI/CD Catalog resources.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Resources  []ResourceItem                   `json:"resources"`
	Pagination toolutil.GraphQLPaginationOutput `json:"pagination"`
}

ListOutput is the output for listing CI/CD Catalog resources.

func List

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

List retrieves CI/CD Catalog resources via the GitLab GraphQL API.

type ResourceDetail

type ResourceDetail struct {
	ResourceItem
	ReadmeHTML string          `json:"readme_html,omitempty"`
	Versions   []VersionItem   `json:"versions,omitempty"`
	Components []ComponentItem `json:"components,omitempty"`
}

ResourceDetail extends ResourceItem with version and component information.

type ResourceItem

type ResourceItem struct {
	ID                string `json:"id"`
	Name              string `json:"name"`
	Description       string `json:"description,omitempty"`
	Icon              string `json:"icon,omitempty"`
	FullPath          string `json:"full_path"`
	WebURL            string `json:"web_url"`
	StarCount         int    `json:"star_count"`
	ForksCount        int    `json:"forks_count"`
	OpenIssuesCount   int    `json:"open_issues_count"`
	OpenMRsCount      int    `json:"open_merge_requests_count"`
	LatestReleasedAt  string `json:"latest_released_at,omitempty"`
	LatestVersionName string `json:"latest_version_name,omitempty"`
}

ResourceItem represents a CI/CD Catalog resource summary.

type VersionItem

type VersionItem struct {
	Name       string          `json:"name"`
	ReleasedAt string          `json:"released_at"`
	Components []ComponentItem `json:"components,omitempty"`
}

VersionItem represents a released version of a catalog resource.

Jump to

Keyboard shortcuts

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