# Templates and CI lint

GitLab's built-in templates for CI/CD YAML, Dockerfiles, .gitignore files, licenses and projects, and the CI lint.

Source: https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/
Updated: 2026-11-22

---

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

- "List the CI/CD templates"
- "Show the Go .gitignore template"
- "Validate this .gitlab-ci.yml against project 42"

## How to call it

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

## 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

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.6.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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateci_yml_get) | `gitlab_get_ci_yml_template` |
| [`template.ci_yml_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateci_yml_list) | `gitlab_list_ci_yml_templates` |
| [`template.dockerfile_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatedockerfile_get) | `gitlab_get_dockerfile_template` |
| [`template.dockerfile_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatedockerfile_list) | `gitlab_list_dockerfile_templates` |
| [`template.gitignore_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_get) | `gitlab_get_gitignore_template` |
| [`template.gitignore_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_list) | `gitlab_list_gitignore_templates` |
| [`template.license_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelicense_get) | `gitlab_get_license_template` |
| [`template.license_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelicense_list) | `gitlab_list_license_templates` |
| [`template.lint`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint) | `gitlab_ci_lint` |
| [`template.lint_project`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint_project) | `gitlab_ci_lint_project` |
| [`template.project_template_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateproject_template_get) | `gitlab_get_project_template` |
| [`template.project_template_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateproject_template_list) | `gitlab_list_project_templates` |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateci_yml_list), [`template.lint`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **Behavior**: read-only, idempotent

| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `key` | `string` | yes | Template key (e.g. Go, Python) |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateci_yml_get), [`template.lint`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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) |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatedockerfile_list), [`template.gitignore_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **Behavior**: read-only, idempotent

| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `key` | `string` | yes | Template key |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatedockerfile_get), [`template.gitignore_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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) |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_list), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **Behavior**: read-only, idempotent

| Parameter | Type | Mandatory | Description |
| --- | --- | --- | --- |
| `key` | `string` | yes | Template key (e.g. Go, Python, Node) |

### `template.gitignore_list`

> 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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templategitignore_get), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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) |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelicense_list), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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`

> 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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelicense_get), [`repository.file_create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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) |

### `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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint_project), [`pipeline.create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/pipeline/#pipelinecreate), [`ci_catalog.list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/ci-catalog/#ci_cataloglist).

- **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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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`

> 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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templatelint), [`pipeline.create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/pipeline/#pipelinecreate), [`repository.file_get`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/repository/#repositoryfile_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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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`

> Returns: one project template's full content by template_type and key. See also: [`template.project_template_list`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateproject_template_list), [`project.create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/project/#projectcreate).

- **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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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`

> 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`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/template/#templateproject_template_get), [`project.create`](https://docs.jmrp.io/gitlab-mcp-server/reference/tools/project/#projectcreate).

- **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](https://docs.jmrp.io/gitlab-mcp-server/reference/fine-grained-permissions/#template))
- **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) |
