projecttemplates

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package projecttemplates implements MCP tools for GitLab project template operations.

The package wraps the GitLab Templates API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for project template actions.

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.

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               `` /* 153-byte string literal not displayed */
	ID           int64                `json:"id,omitempty" jsonschema:"Filter to a single template by numeric id (maps to gl.ListProjectTemplatesOptions.ID)"`
	Type         string               `` /* 157-byte string literal not displayed */
	OrderBy      string               `json:"order_by,omitempty" jsonschema:"Column by which to order keyset-paginated results"`
	Sort         string               `json:"sort,omitempty" jsonschema:"Sort direction for keyset-paginated results (asc, desc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListInput contains parameters for listing project templates of a given type. It mirrors gl.ListProjectTemplatesOptions (id, type) and the embedded gl.ListOptions (order_by, sort, pagination, page_token) so every SDK filter and pagination knob is available on the MCP surface.

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