GitLab CI/CD · Capability

GitLab API — project_templates

GitLab API — project_templates. 2 operations. Lead operation: Get a list of templates available to this project. Self-contained Naftiko capability covering one Gitlab Ci business surface.

Run with Naftiko Gitlab Ciproject_templates

What You Can Do

GET
Getapiv4projectsidtemplatestype — Get a list of templates available to this project
/v1/api/v4/projects/{id}/templates/{type}
GET
Getapiv4projectsidtemplatestypename — Download a template available to this project
/v1/api/v4/projects/{id}/templates/{type}/{name}

MCP Tools

get-list-templates-available-this

Get a list of templates available to this project

read-only idempotent
download-template-available-this-project

Download a template available to this project

read-only idempotent

Capability Spec

gitlab-ci-project-templates.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: GitLab API — project_templates
  description: 'GitLab API — project_templates. 2 operations. Lead operation: Get a list of templates available to this project.
    Self-contained Naftiko capability covering one Gitlab Ci business surface.'
  tags:
  - Gitlab Ci
  - project_templates
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GITLAB_CI_API_KEY: GITLAB_CI_API_KEY
capability:
  consumes:
  - type: http
    namespace: gitlab-ci-project-templates
    baseUri: https://gitlab.com
    description: GitLab API — project_templates business capability. Self-contained, no shared references.
    resources:
    - name: api-v4-projects-id-templates-type
      path: /api/v4/projects/{id}/templates/{type}
      operations:
      - name: getapiv4projectsidtemplatestype
        method: GET
        description: Get a list of templates available to this project
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: The ID or URL-encoded path of the project
          required: true
        - name: type
          in: path
          type: string
          description: The type (dockerfiles|gitignores|gitlab_ci_ymls|licenses|issues|merge_requests) of the template
          required: true
        - name: page
          in: query
          type: integer
          description: Current page number
        - name: per_page
          in: query
          type: integer
          description: Number of items per page
    - name: api-v4-projects-id-templates-type-name
      path: /api/v4/projects/{id}/templates/{type}/{name}
      operations:
      - name: getapiv4projectsidtemplatestypename
        method: GET
        description: Download a template available to this project
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: The ID or URL-encoded path of the project
          required: true
        - name: type
          in: path
          type: string
          description: The type (dockerfiles|gitignores|gitlab_ci_ymls|licenses|issues|merge_requests) of the template
          required: true
        - name: name
          in: path
          type: string
          description: The key of the template, as obtained from the collection endpoint.
          required: true
        - name: source_template_project_id
          in: query
          type: integer
          description: The project id where a given template is being stored. This is useful when multiple templates from
            different projects have the same name
        - name: project
          in: query
          type: string
          description: The project name to use when expanding placeholders in the template. Only affects licenses
        - name: fullname
          in: query
          type: string
          description: The full name of the copyright holder to use when expanding placeholders in the template. Only affects
            licenses
  exposes:
  - type: rest
    namespace: gitlab-ci-project-templates-rest
    port: 8080
    description: REST adapter for GitLab API — project_templates. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/api/v4/projects/{id}/templates/{type}
      name: api-v4-projects-id-templates-type
      description: REST surface for api-v4-projects-id-templates-type.
      operations:
      - method: GET
        name: getapiv4projectsidtemplatestype
        description: Get a list of templates available to this project
        call: gitlab-ci-project-templates.getapiv4projectsidtemplatestype
        with:
          id: rest.id
          type: rest.type
          page: rest.page
          per_page: rest.per_page
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/templates/{type}/{name}
      name: api-v4-projects-id-templates-type-name
      description: REST surface for api-v4-projects-id-templates-type-name.
      operations:
      - method: GET
        name: getapiv4projectsidtemplatestypename
        description: Download a template available to this project
        call: gitlab-ci-project-templates.getapiv4projectsidtemplatestypename
        with:
          id: rest.id
          type: rest.type
          name: rest.name
          source_template_project_id: rest.source_template_project_id
          project: rest.project
          fullname: rest.fullname
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: gitlab-ci-project-templates-mcp
    port: 9090
    transport: http
    description: MCP adapter for GitLab API — project_templates. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: get-list-templates-available-this
      description: Get a list of templates available to this project
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-project-templates.getapiv4projectsidtemplatestype
      with:
        id: tools.id
        type: tools.type
        page: tools.page
        per_page: tools.per_page
      outputParameters:
      - type: object
        mapping: $.
    - name: download-template-available-this-project
      description: Download a template available to this project
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-project-templates.getapiv4projectsidtemplatestypename
      with:
        id: tools.id
        type: tools.type
        name: tools.name
        source_template_project_id: tools.source_template_project_id
        project: tools.project
        fullname: tools.fullname
      outputParameters:
      - type: object
        mapping: $.