Skip to content

Templates and CI lint

The templates GitLab ships: CI/CD YAML, Dockerfiles, .gitignore files and licenses, each listed and read by name, and the project templates of a project or group. template.lint validates CI/CD configuration given as text, and template.lint_project validates a project’s committed .gitlab-ci.yml, both without running a pipeline. Every action only reads.

  • “List the CI/CD templates”
  • “Show the Go .gitignore template”
  • “Validate this .gitlab-ci.yml against project 42”
  • Dynamic, the default surface: call gitlab_execute_action with action set to the action’s ID, such as template.ci_yml_get, and its parameters in params. gitlab_find_action finds an ID from a description of the task.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): call gitlab_template with action set to the action’s name, such as ci_yml_get, and its parameters in params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): call the action’s own tool, such as gitlab_get_ci_yml_template, with its parameters as the arguments.

Every tier serves the whole group, on self-managed instances and on GitLab.com alike.

Read-only actions: 12 of 12, the ones a deployment in read-only mode keeps. A token with read_api and not api is served 11 of the 12.

The description of each action, and of each of its parameters, is the text the server serves for it on the default surface, quoted as served. The token lines say what GitLab 19.4.1 requires of a token for the requests each action sends; on an instance with Admin Mode turned on, an action only an administrator may run also needs admin_mode.

ActionIndividual
template.ci_yml_getgitlab_get_ci_yml_template
template.ci_yml_listgitlab_list_ci_yml_templates
template.dockerfile_getgitlab_get_dockerfile_template
template.dockerfile_listgitlab_list_dockerfile_templates
template.gitignore_getgitlab_get_gitignore_template
template.gitignore_listgitlab_list_gitignore_templates
template.license_getgitlab_get_license_template
template.license_listgitlab_list_license_templates
template.lintgitlab_ci_lint
template.lint_projectgitlab_ci_lint_project
template.project_template_getgitlab_get_project_template
template.project_template_listgitlab_list_project_templates

Get a single GitLab CI/CD pipeline YAML template by key. Returns: the template name and full YAML content to copy into a .gitlab-ci.yml file. See also: template.ci_yml_list, template.lint, repository.file_create.

  • Meta-tool: gitlab_template, action ci_yml_get
  • Individual tool: gitlab_get_ci_yml_template
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
keystringyesTemplate key (e.g. Go, Python)

List the GitLab-provided CI/CD pipeline YAML templates. Returns: available templates with key and name, plus pagination metadata. See also: template.ci_yml_get, template.lint, repository.file_create.

  • Meta-tool: gitlab_template, action ci_yml_list
  • Individual tool: gitlab_list_ci_yml_templates
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
order_bystringnoColumn to order results by for keyset pagination (e.g. id, name, created_at, updated_at)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction (asc, desc)

Get a single Dockerfile template by key. Returns: the template name and full Dockerfile content ready to commit as a project’s Dockerfile. See also: template.dockerfile_list, template.gitignore_get.

  • Meta-tool: gitlab_template, action dockerfile_get
  • Individual tool: gitlab_get_dockerfile_template
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
keystringyesTemplate key

List available Dockerfile templates with pagination and sorting. Returns: matching templates with key and name plus pagination metadata. See also: template.dockerfile_get, template.gitignore_list.

  • Meta-tool: gitlab_template, action dockerfile_list
  • Individual tool: gitlab_list_dockerfile_templates
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
order_bystringnoOrder results by a field supported by the templates endpoint (e.g. key, name)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction (asc, desc)

Get one .gitignore template by key (e.g. Go, Python, Node). Returns: the template’s name and full file content ready to copy into .gitignore. See also: template.gitignore_list, repository.file_create.

  • Meta-tool: gitlab_template, action gitignore_get
  • Individual tool: gitlab_get_gitignore_template
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
keystringyesTemplate key (e.g. Go, Python, Node)

List available .gitignore templates with order_by, sort, and offset or keyset pagination. Returns: each template’s key and name, plus pagination metadata. See also: template.gitignore_get, repository.file_create.

  • Meta-tool: gitlab_template, action gitignore_list
  • Individual tool: gitlab_list_gitignore_templates
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
order_bystringnoColumn to order results by for keyset pagination (e.g. id, name, created_at, updated_at)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction (asc, desc)

Get a single license template by key, optionally substituting project and fullname placeholders. Returns: the license’s key, name, nickname, featured flag, source/HTML URLs, description, conditions, permissions, limitations, and rendered content. See also: template.license_list, repository.file_create.

  • Meta-tool: gitlab_template, action license_get
  • Individual tool: gitlab_get_license_template
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
keystringyesLicense template key (e.g. mit, apache-2.0)
fullnamestringnoFull name to replace in license
projectstringnoProject name to replace in license

List available license templates with an optional popular filter, order_by/sort, and offset or keyset pagination. Returns: each template’s key, name, nickname, featured flag, source/HTML URLs, description, conditions, permissions, limitations, and content, with pagination metadata. See also: template.license_get, repository.file_create.

  • Meta-tool: gitlab_template, action license_list
  • Individual tool: gitlab_list_license_templates
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: a request GitLab does not judge by the grant (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
order_bystringnoColumn by which to order keyset-paginated results
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
popularbooleannoFilter by popular licenses
sortstring (asc, desc)noSort direction for keyset-paginated results (asc, desc)

Validate inline .gitlab-ci.yml content within a project namespace. Returns: validity flag, errors, warnings, the merged YAML, and resolved includes. See also: template.lint_project, pipeline.create, ci_catalog.list.

  • Meta-tool: gitlab_template, action lint
  • Individual tool: gitlab_ci_lint
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: CI Config: Validate at project (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
contentstringyesCI/CD YAML content to validate
project_idstring/integeryesProject ID or URL-encoded path (namespace context)
dry_runbooleannoRun pipeline creation simulation
include_jobsbooleannoInclude expanded job list in the response
refstringnoBranch or tag to use for CI includes resolution

Validate a project’s committed .gitlab-ci.yml at a branch or tag. Returns: validity flag, errors, warnings, the merged YAML, and resolved includes. See also: template.lint, pipeline.create, repository.file_get.

  • Meta-tool: gitlab_template, action lint_project
  • Individual tool: gitlab_ci_lint_project
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: CI Config: Read at project (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
project_idstring/integeryesProject ID or URL-encoded path
content_refstringnoBranch or tag to use for the CI configuration content
dry_runbooleannoRun pipeline creation simulation
dry_run_refstringnoBranch or tag to use as context for the dry run
include_jobsbooleannoInclude expanded job list in the response
refstringnoBranch or tag to use for CI includes resolution

Returns: one project template’s full content by template_type and key. See also: template.project_template_list, project.create.

  • Meta-tool: gitlab_template, action project_template_get
  • Individual tool: gitlab_get_project_template
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Template: Read at project (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
keystringyesTemplate key/name
project_idstring/integeryesProject ID or URL-encoded path
template_typestring (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests)yesTemplate family in the request path: dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests

List project templates of a given template_type with optional id/type filters, order_by/sort, and offset or keyset pagination. Returns: each template’s key, name, nickname, popularity, and source/HTML URLs. See also: template.project_template_get, project.create.

  • Meta-tool: gitlab_template, action project_template_list
  • Individual tool: gitlab_list_project_templates
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Template: Read at project (permissions page)
  • Behavior: read-only, idempotent
ParameterTypeMandatoryDescription
project_idstring/integeryesProject ID or URL-encoded path
template_typestring (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests)yesTemplate family in the request path: dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests
idintegernoFilter to a single template by numeric id (maps to gl.ListProjectTemplatesOptions.ID)
order_bystringnoColumn by which to order keyset-paginated results
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction for keyset-paginated results (asc, desc)
typestringnoOptional secondary template type filter passed as the ‘type’ query parameter (maps to gl.ListProjectTemplatesOptions.Type)