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.5.0 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.

Action Individual
template.ci_yml_get gitlab_get_ci_yml_template
template.ci_yml_list gitlab_list_ci_yml_templates
template.dockerfile_get gitlab_get_dockerfile_template
template.dockerfile_list gitlab_list_dockerfile_templates
template.gitignore_get gitlab_get_gitignore_template
template.gitignore_list gitlab_list_gitignore_templates
template.license_get gitlab_get_license_template
template.license_list gitlab_list_license_templates
template.lint gitlab_ci_lint
template.lint_project gitlab_ci_lint_project
template.project_template_get gitlab_get_project_template
template.project_template_list gitlab_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
Parameter Type Mandatory Description
key string yes Template 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
Parameter Type Mandatory Description
order_by string no Column to order results by (e.g. id, name, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort 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
Parameter Type Mandatory Description
key string yes Template 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
Parameter Type Mandatory Description
order_by string no Order results by a field supported by the templates endpoint (e.g. key, name)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort 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
Parameter Type Mandatory Description
key string yes Template key (e.g. Go, Python, Node)

List available .gitignore templates with order_by, sort, and offset 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
Parameter Type Mandatory Description
order_by string no Column to order results by (e.g. id, name, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort 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
Parameter Type Mandatory Description
key string yes License template key (e.g. mit, apache-2.0)
fullname string no Full name to replace in license
project string no Project name to replace in license

List available license templates with an optional popular filter, order_by/sort, and offset 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
Parameter Type Mandatory Description
order_by string no Column by which to order results
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
popular boolean no Filter by popular licenses
sort string (asc, desc) no Sort direction (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
Parameter Type Mandatory Description
content string yes CI/CD YAML content to validate
project_id string/integer yes Project ID or URL-encoded path (namespace context)
dry_run boolean no Run pipeline creation simulation
include_jobs boolean no Include expanded job list in the response
ref string no Branch 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
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
content_ref string no Branch or tag to use for the CI configuration content
dry_run boolean no Run pipeline creation simulation
dry_run_ref string no Branch or tag to use as context for the dry run
include_jobs boolean no Include expanded job list in the response
ref string no Branch 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
Parameter Type Mandatory Description
key string yes Template key/name
project_id string/integer yes Project ID or URL-encoded path
template_type string (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests) yes Template 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 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
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
template_type string (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests) yes Template family in the request path: dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests
id integer no Filter to a single template by numeric id (maps to gl.ListProjectTemplatesOptions.ID)
order_by string no Column by which to order results
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc, desc)
type string no Optional secondary template type filter passed as the ‘type’ query parameter (maps to gl.ListProjectTemplatesOptions.Type)