Ir al contenido

Plantillas y lint de CI

Las plantillas que trae GitLab: YAML de CI/CD, Dockerfiles, archivos .gitignore y licencias, cada una listada y leída por nombre, y las plantillas de proyecto de un proyecto o grupo. template.lint valida configuración de CI/CD dada como texto y template.lint_project valida el .gitlab-ci.yml que tiene un proyecto en el repositorio, las dos sin lanzar un pipeline. Todas las acciones solo leen.

  • “Lista las plantillas de CI/CD”
  • “Muestra la plantilla .gitignore de Go”
  • “Valida este .gitlab-ci.yml contra el proyecto 42”
  • Dinámica, la superficie predeterminada: llama a gitlab_execute_action con action igual al ID de la acción, como template.ci_yml_get, y sus parámetros en params. gitlab_find_action encuentra un ID a partir de una descripción de la tarea.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): llama a gitlab_template con action igual al nombre de la acción, como ci_yml_get, y sus parámetros en params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): llama a la herramienta propia de la acción, como gitlab_get_ci_yml_template, pasándole directamente sus parámetros.

Todos los niveles sirven el grupo completo, tanto en instancias autogestionadas como en GitLab.com.

Acciones de solo lectura: 12 de 12, las que conserva un despliegue en modo de solo lectura.

La descripción de cada acción, y la de cada uno de sus parámetros, es el texto que sirve el servidor para ella en la superficie predeterminada, citado tal cual; por eso está en inglés.

AcciónIndividual
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-herramienta: gitlab_template, acción ci_yml_get
  • Herramienta individual: gitlab_get_ci_yml_template
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
keystringsí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-herramienta: gitlab_template, acción ci_yml_list
  • Herramienta individual: gitlab_list_ci_yml_templates
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
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_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
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-herramienta: gitlab_template, acción dockerfile_get
  • Herramienta individual: gitlab_get_dockerfile_template
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
keystringsí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-herramienta: gitlab_template, acción dockerfile_list
  • Herramienta individual: gitlab_list_dockerfile_templates
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
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_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
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-herramienta: gitlab_template, acción gitignore_get
  • Herramienta individual: gitlab_get_gitignore_template
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
keystringsíTemplate 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-herramienta: gitlab_template, acción gitignore_list
  • Herramienta individual: gitlab_list_gitignore_templates
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
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_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
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-herramienta: gitlab_template, acción license_get
  • Herramienta individual: gitlab_get_license_template
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
keystringsíLicense 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-herramienta: gitlab_template, acción license_list
  • Herramienta individual: gitlab_list_license_templates
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
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_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
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-herramienta: gitlab_template, acción lint
  • Herramienta individual: gitlab_ci_lint
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
contentstringsíCI/CD YAML content to validate
project_idstring/integersíProject 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-herramienta: gitlab_template, acción lint_project
  • Herramienta individual: gitlab_ci_lint_project
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject 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-herramienta: gitlab_template, acción project_template_get
  • Herramienta individual: gitlab_get_project_template
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
keystringsíTemplate key/name
project_idstring/integersíProject ID or URL-encoded path
template_typestring (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests)sí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 or keyset pagination. Returns: each template’s key, name, nickname, popularity, and source/HTML URLs. See also: template.project_template_get, project.create.

  • Meta-herramienta: gitlab_template, acción project_template_list
  • Herramienta individual: gitlab_list_project_templates
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
template_typestring (dockerfiles, gitignores, gitlab_ci_ymls, licenses, issues, merge_requests)síTemplate 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_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
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)