projecttemplates

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 projecttemplates implements MCP tools for GitLab project template operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatGetMarkdown

func FormatGetMarkdown(out GetOutput) string

FormatGetMarkdown formats a single project template as markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats a list of project templates as markdown.

func RegisterTools

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

RegisterTools registers all project template MCP tools on the given server.

Types

type GetInput

type GetInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	TemplateType string               `json:"template_type" jsonschema:"Template type: dockerfiles, gitignores, gitlab_ci_ymls, licenses,required"`
	Key          string               `json:"key" jsonschema:"Template key/name,required"`
}

GetInput contains parameters for getting a single project template.

type GetOutput

type GetOutput struct {
	toolutil.HintableOutput
	TemplateItem
}

GetOutput contains a single project template.

func Get

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

Get retrieves a single project template by type and key.

type ListInput

type ListInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	TemplateType string               `json:"template_type" jsonschema:"Template type: dockerfiles, gitignores, gitlab_ci_ymls, licenses,required"`
	Page         int64                `json:"page" jsonschema:"Page number for pagination"`
	PerPage      int64                `json:"per_page" jsonschema:"Number of items per page"`
}

ListInput contains parameters for listing project templates of a given type.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Templates  []TemplateItem            `json:"templates"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput contains a list of project templates.

func List

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

List retrieves project templates of a given type.

type TemplateItem

type TemplateItem struct {
	Key         string   `json:"key"`
	Name        string   `json:"name"`
	Nickname    string   `json:"nickname,omitempty"`
	Popular     bool     `json:"popular,omitempty"`
	HTMLURL     string   `json:"html_url,omitempty"`
	SourceURL   string   `json:"source_url,omitempty"`
	Description string   `json:"description,omitempty"`
	Conditions  []string `json:"conditions,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
	Limitations []string `json:"limitations,omitempty"`
	Content     string   `json:"content,omitempty"`
}

TemplateItem represents a single project template entry.

Jump to

Keyboard shortcuts

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