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.
Sample questions
Section titled “Sample questions”- “List the CI/CD templates”
- “Show the Go .gitignore template”
- “Validate this .gitlab-ci.yml against project 42”
How to call it
Section titled “How to call it”- Dynamic, the default surface: call
gitlab_execute_actionwithactionset to the action’s ID, such astemplate.ci_yml_get, and its parameters inparams.gitlab_find_actionfinds an ID from a description of the task. - Meta (
GITLAB_MCP_TOOL_SURFACE=meta): callgitlab_templatewithactionset to the action’s name, such asci_yml_get, and its parameters inparams. - Individual (
GITLAB_MCP_TOOL_SURFACE=individual): call the action’s own tool, such asgitlab_get_ci_yml_template, with its parameters as the arguments.
Availability
Section titled “Availability”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.
Actions
Section titled “Actions”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.
| 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 |
template.ci_yml_get
Section titled “template.ci_yml_get”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, actionci_yml_get - Individual tool:
gitlab_get_ci_yml_template - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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) |
template.ci_yml_list
Section titled “template.ci_yml_list”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, actionci_yml_list - Individual tool:
gitlab_list_ci_yml_templates - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 for keyset pagination (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. |
page_token | string | no | Next 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. |
pagination | string | no | Pagination 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_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) |
template.dockerfile_get
Section titled “template.dockerfile_get”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, actiondockerfile_get - Individual tool:
gitlab_get_dockerfile_template - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 |
template.dockerfile_list
Section titled “template.dockerfile_list”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, actiondockerfile_list - Individual tool:
gitlab_list_dockerfile_templates - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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. |
page_token | string | no | Next 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. |
pagination | string | no | Pagination 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_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) |
template.gitignore_get
Section titled “template.gitignore_get”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, actiongitignore_get - Individual tool:
gitlab_get_gitignore_template - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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) |
template.gitignore_list
Section titled “template.gitignore_list”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, actiongitignore_list - Individual tool:
gitlab_list_gitignore_templates - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 for keyset pagination (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. |
page_token | string | no | Next 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. |
pagination | string | no | Pagination 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_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) |
template.license_get
Section titled “template.license_get”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, actionlicense_get - Individual tool:
gitlab_get_license_template - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 |
template.license_list
Section titled “template.license_list”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, actionlicense_list - Individual tool:
gitlab_list_license_templates - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 keyset-paginated 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. |
page_token | string | no | Next 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. |
pagination | string | no | Pagination 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_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 for keyset-paginated results (asc, desc) |
template.lint
Section titled “template.lint”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, actionlint - 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 |
template.lint_project
Section titled “template.lint_project”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, actionlint_project - Individual tool:
gitlab_ci_lint_project - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 |
template.project_template_get
Section titled “template.project_template_get”Returns: one project template’s full content by template_type and key. See also:
template.project_template_list,project.create.
- Meta-tool:
gitlab_template, actionproject_template_get - Individual tool:
gitlab_get_project_template - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 |
template.project_template_list
Section titled “template.project_template_list”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, actionproject_template_list - Individual tool:
gitlab_list_project_templates - Tier: Free
- Classic or OAuth token:
read_api(orapi) - 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 keyset-paginated 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. |
page_token | string | no | Next 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. |
pagination | string | no | Pagination 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_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 for keyset-paginated results (asc, desc) |
type | string | no | Optional secondary template type filter passed as the ‘type’ query parameter (maps to gl.ListProjectTemplatesOptions.Type) |