GitLab CI/CD · Capability

GitLab API — repositories

GitLab API — repositories. 10 operations. Lead operation: Generates a changelog section for a release and returns it. Self-contained Naftiko capability covering one Gitlab Ci business surface.

Run with Naftiko Gitlab Cirepositories

What You Can Do

GET
Getapiv4projectsidrepositoryarchive — Get an archive of the repository
/v1/api/v4/projects/{id}/repository/archive
GET
Getapiv4projectsidrepositoryblobssha — Get a blob from the repository
/v1/api/v4/projects/{id}/repository/blobs/{sha}
GET
Getapiv4projectsidrepositoryblobssharaw — Get raw blob contents from the repository
/v1/api/v4/projects/{id}/repository/blobs/{sha}/raw
GET
Getapiv4projectsidrepositorychangelog — Generates a changelog section for a release and returns it
/v1/api/v4/projects/{id}/repository/changelog
POST
Postapiv4projectsidrepositorychangelog — Generates a changelog section for a release and commits it in a changelog file
/v1/api/v4/projects/{id}/repository/changelog
GET
Getapiv4projectsidrepositorycompare — Compare two branches, tags, or commits
/v1/api/v4/projects/{id}/repository/compare
GET
Getapiv4projectsidrepositorycontributors — Get repository contributors
/v1/api/v4/projects/{id}/repository/contributors
GET
Getapiv4projectsidrepositoryhealth — Get repository health
/v1/api/v4/projects/{id}/repository/health
GET
Getapiv4projectsidrepositorymergebase — Get the common ancestor between commits
/v1/api/v4/projects/{id}/repository/merge-base
GET
Getapiv4projectsidrepositorytree — Get a project repository tree
/v1/api/v4/projects/{id}/repository/tree

MCP Tools

get-archive-repository

Get an archive of the repository

read-only idempotent
get-blob-repository

Get a blob from the repository

read-only idempotent
get-raw-blob-contents-repository

Get raw blob contents from the repository

read-only idempotent
generates-changelog-section-release-and

Generates a changelog section for a release and returns it

read-only idempotent
generates-changelog-section-release-and-2

Generates a changelog section for a release and commits it in a changelog file

compare-two-branches-tags-commits

Compare two branches, tags, or commits

read-only idempotent
get-repository-contributors

Get repository contributors

read-only idempotent
get-repository-health

Get repository health

read-only idempotent
get-common-ancestor-between-commits

Get the common ancestor between commits

read-only idempotent
get-project-repository-tree

Get a project repository tree

read-only idempotent

Capability Spec

gitlab-ci-repositories.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: GitLab API — repositories
  description: 'GitLab API — repositories. 10 operations. Lead operation: Generates a changelog section for a release and
    returns it. Self-contained Naftiko capability covering one Gitlab Ci business surface.'
  tags:
  - Gitlab Ci
  - repositories
  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-repositories
    baseUri: https://gitlab.com
    description: GitLab API — repositories business capability. Self-contained, no shared references.
    resources:
    - name: api-v4-projects-id-repository-archive
      path: /api/v4/projects/{id}/repository/archive
      operations:
      - name: getapiv4projectsidrepositoryarchive
        method: GET
        description: Get an archive of the repository
        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: sha
          in: query
          type: string
          description: The commit sha of the archive to be downloaded
        - name: format
          in: query
          type: string
          description: The archive format
        - name: path
          in: query
          type: string
          description: Subfolder of the repository to be downloaded
        - name: include_lfs_blobs
          in: query
          type: boolean
          description: Used to exclude LFS objects from archive
        - name: exclude_paths
          in: query
          type: array
          description: Comma-separated list of paths to exclude from the archive
    - name: api-v4-projects-id-repository-blobs-sha
      path: /api/v4/projects/{id}/repository/blobs/{sha}
      operations:
      - name: getapiv4projectsidrepositoryblobssha
        method: GET
        description: Get a blob from the repository
        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: sha
          in: path
          type: string
          description: The commit hash
          required: true
    - name: api-v4-projects-id-repository-blobs-sha-raw
      path: /api/v4/projects/{id}/repository/blobs/{sha}/raw
      operations:
      - name: getapiv4projectsidrepositoryblobssharaw
        method: GET
        description: Get raw blob contents from the repository
        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: sha
          in: path
          type: string
          description: The commit hash
          required: true
    - name: api-v4-projects-id-repository-changelog
      path: /api/v4/projects/{id}/repository/changelog
      operations:
      - name: getapiv4projectsidrepositorychangelog
        method: GET
        description: Generates a changelog section for a release and returns it
        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: version
          in: query
          type: string
          description: The version of the release, using the semantic versioning format
          required: true
        - name: from
          in: query
          type: string
          description: The first commit in the range of commits to use for the changelog
        - name: to
          in: query
          type: string
          description: The last commit in the range of commits to use for the changelog
        - name: date
          in: query
          type: string
          description: The date and time of the release
        - name: trailer
          in: query
          type: string
          description: The Git trailer to use for determining if commits are to be included in the changelog
        - name: config_file
          in: query
          type: string
          description: The file path to the configuration file as stored in the project's Git repository. Defaults to '.gitlab/changelog_config.yml'
        - name: config_file_ref
          in: query
          type: string
          description: The git reference (for example, branch) where the changelog configuration file is defined. Defaults
            to the default repository branch.
      - name: postapiv4projectsidrepositorychangelog
        method: POST
        description: Generates a changelog section for a release and commits it in a changelog file
        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: postApiV4ProjectsIdRepositoryChangelog
          in: body
          type: string
          required: true
    - name: api-v4-projects-id-repository-compare
      path: /api/v4/projects/{id}/repository/compare
      operations:
      - name: getapiv4projectsidrepositorycompare
        method: GET
        description: Compare two branches, tags, or commits
        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: from
          in: query
          type: string
          description: The commit, branch name, or tag name to start comparison
          required: true
        - name: to
          in: query
          type: string
          description: The commit, branch name, or tag name to stop comparison
          required: true
        - name: from_project_id
          in: query
          type: integer
          description: The project to compare from
        - name: straight
          in: query
          type: boolean
          description: Comparison method, `true` for direct comparison between `from` and `to` (`from`..`to`), `false` to
            compare using merge base (`from`...`to`)
        - name: unidiff
          in: query
          type: boolean
          description: A diff in a Unified diff format
    - name: api-v4-projects-id-repository-contributors
      path: /api/v4/projects/{id}/repository/contributors
      operations:
      - name: getapiv4projectsidrepositorycontributors
        method: GET
        description: Get repository contributors
        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: page
          in: query
          type: integer
          description: Current page number
        - name: per_page
          in: query
          type: integer
          description: Number of items per page
        - name: ref
          in: query
          type: string
          description: The name of a repository branch or tag, if not given the default branch is used
        - name: order_by
          in: query
          type: string
          description: Return contributors ordered by `name` or `email` or `commits`
        - name: sort
          in: query
          type: string
          description: Sort by asc (ascending) or desc (descending)
    - name: api-v4-projects-id-repository-health
      path: /api/v4/projects/{id}/repository/health
      operations:
      - name: getapiv4projectsidrepositoryhealth
        method: GET
        description: Get repository health
        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: generate
          in: query
          type: boolean
          description: Triggers a new health report to be generated
    - name: api-v4-projects-id-repository-merge_base
      path: /api/v4/projects/{id}/repository/merge_base
      operations:
      - name: getapiv4projectsidrepositorymergebase
        method: GET
        description: Get the common ancestor between commits
        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: refs
          in: query
          type: array
          description: The refs to find the common ancestor of, multiple refs can be passed
          required: true
    - name: api-v4-projects-id-repository-tree
      path: /api/v4/projects/{id}/repository/tree
      operations:
      - name: getapiv4projectsidrepositorytree
        method: GET
        description: Get a project repository tree
        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: ref
          in: query
          type: string
          description: The name of a repository branch or tag, if not given the default branch is used
        - name: path
          in: query
          type: string
          description: The path of the tree
        - name: recursive
          in: query
          type: boolean
          description: Used to get a recursive tree
        - name: page
          in: query
          type: integer
          description: Current page number
        - name: per_page
          in: query
          type: integer
          description: Number of items per page
        - name: pagination
          in: query
          type: string
          description: Specify the pagination method ("none" is only valid if "recursive" is true)
        - name: page_token
          in: query
          type: string
          description: Record from which to start the keyset pagination
  exposes:
  - type: rest
    namespace: gitlab-ci-repositories-rest
    port: 8080
    description: REST adapter for GitLab API — repositories. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/v4/projects/{id}/repository/archive
      name: api-v4-projects-id-repository-archive
      description: REST surface for api-v4-projects-id-repository-archive.
      operations:
      - method: GET
        name: getapiv4projectsidrepositoryarchive
        description: Get an archive of the repository
        call: gitlab-ci-repositories.getapiv4projectsidrepositoryarchive
        with:
          id: rest.id
          sha: rest.sha
          format: rest.format
          path: rest.path
          include_lfs_blobs: rest.include_lfs_blobs
          exclude_paths: rest.exclude_paths
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/blobs/{sha}
      name: api-v4-projects-id-repository-blobs-sha
      description: REST surface for api-v4-projects-id-repository-blobs-sha.
      operations:
      - method: GET
        name: getapiv4projectsidrepositoryblobssha
        description: Get a blob from the repository
        call: gitlab-ci-repositories.getapiv4projectsidrepositoryblobssha
        with:
          id: rest.id
          sha: rest.sha
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/blobs/{sha}/raw
      name: api-v4-projects-id-repository-blobs-sha-raw
      description: REST surface for api-v4-projects-id-repository-blobs-sha-raw.
      operations:
      - method: GET
        name: getapiv4projectsidrepositoryblobssharaw
        description: Get raw blob contents from the repository
        call: gitlab-ci-repositories.getapiv4projectsidrepositoryblobssharaw
        with:
          id: rest.id
          sha: rest.sha
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/changelog
      name: api-v4-projects-id-repository-changelog
      description: REST surface for api-v4-projects-id-repository-changelog.
      operations:
      - method: GET
        name: getapiv4projectsidrepositorychangelog
        description: Generates a changelog section for a release and returns it
        call: gitlab-ci-repositories.getapiv4projectsidrepositorychangelog
        with:
          id: rest.id
          version: rest.version
          from: rest.from
          to: rest.to
          date: rest.date
          trailer: rest.trailer
          config_file: rest.config_file
          config_file_ref: rest.config_file_ref
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: postapiv4projectsidrepositorychangelog
        description: Generates a changelog section for a release and commits it in a changelog file
        call: gitlab-ci-repositories.postapiv4projectsidrepositorychangelog
        with:
          id: rest.id
          postApiV4ProjectsIdRepositoryChangelog: rest.postApiV4ProjectsIdRepositoryChangelog
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/compare
      name: api-v4-projects-id-repository-compare
      description: REST surface for api-v4-projects-id-repository-compare.
      operations:
      - method: GET
        name: getapiv4projectsidrepositorycompare
        description: Compare two branches, tags, or commits
        call: gitlab-ci-repositories.getapiv4projectsidrepositorycompare
        with:
          id: rest.id
          from: rest.from
          to: rest.to
          from_project_id: rest.from_project_id
          straight: rest.straight
          unidiff: rest.unidiff
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/contributors
      name: api-v4-projects-id-repository-contributors
      description: REST surface for api-v4-projects-id-repository-contributors.
      operations:
      - method: GET
        name: getapiv4projectsidrepositorycontributors
        description: Get repository contributors
        call: gitlab-ci-repositories.getapiv4projectsidrepositorycontributors
        with:
          id: rest.id
          page: rest.page
          per_page: rest.per_page
          ref: rest.ref
          order_by: rest.order_by
          sort: rest.sort
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/health
      name: api-v4-projects-id-repository-health
      description: REST surface for api-v4-projects-id-repository-health.
      operations:
      - method: GET
        name: getapiv4projectsidrepositoryhealth
        description: Get repository health
        call: gitlab-ci-repositories.getapiv4projectsidrepositoryhealth
        with:
          id: rest.id
          generate: rest.generate
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/merge-base
      name: api-v4-projects-id-repository-merge-base
      description: REST surface for api-v4-projects-id-repository-merge_base.
      operations:
      - method: GET
        name: getapiv4projectsidrepositorymergebase
        description: Get the common ancestor between commits
        call: gitlab-ci-repositories.getapiv4projectsidrepositorymergebase
        with:
          id: rest.id
          refs: rest.refs
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v4/projects/{id}/repository/tree
      name: api-v4-projects-id-repository-tree
      description: REST surface for api-v4-projects-id-repository-tree.
      operations:
      - method: GET
        name: getapiv4projectsidrepositorytree
        description: Get a project repository tree
        call: gitlab-ci-repositories.getapiv4projectsidrepositorytree
        with:
          id: rest.id
          ref: rest.ref
          path: rest.path
          recursive: rest.recursive
          page: rest.page
          per_page: rest.per_page
          pagination: rest.pagination
          page_token: rest.page_token
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: gitlab-ci-repositories-mcp
    port: 9090
    transport: http
    description: MCP adapter for GitLab API — repositories. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-archive-repository
      description: Get an archive of the repository
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositoryarchive
      with:
        id: tools.id
        sha: tools.sha
        format: tools.format
        path: tools.path
        include_lfs_blobs: tools.include_lfs_blobs
        exclude_paths: tools.exclude_paths
      outputParameters:
      - type: object
        mapping: $.
    - name: get-blob-repository
      description: Get a blob from the repository
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositoryblobssha
      with:
        id: tools.id
        sha: tools.sha
      outputParameters:
      - type: object
        mapping: $.
    - name: get-raw-blob-contents-repository
      description: Get raw blob contents from the repository
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositoryblobssharaw
      with:
        id: tools.id
        sha: tools.sha
      outputParameters:
      - type: object
        mapping: $.
    - name: generates-changelog-section-release-and
      description: Generates a changelog section for a release and returns it
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositorychangelog
      with:
        id: tools.id
        version: tools.version
        from: tools.from
        to: tools.to
        date: tools.date
        trailer: tools.trailer
        config_file: tools.config_file
        config_file_ref: tools.config_file_ref
      outputParameters:
      - type: object
        mapping: $.
    - name: generates-changelog-section-release-and-2
      description: Generates a changelog section for a release and commits it in a changelog file
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: gitlab-ci-repositories.postapiv4projectsidrepositorychangelog
      with:
        id: tools.id
        postApiV4ProjectsIdRepositoryChangelog: tools.postApiV4ProjectsIdRepositoryChangelog
      outputParameters:
      - type: object
        mapping: $.
    - name: compare-two-branches-tags-commits
      description: Compare two branches, tags, or commits
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositorycompare
      with:
        id: tools.id
        from: tools.from
        to: tools.to
        from_project_id: tools.from_project_id
        straight: tools.straight
        unidiff: tools.unidiff
      outputParameters:
      - type: object
        mapping: $.
    - name: get-repository-contributors
      description: Get repository contributors
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositorycontributors
      with:
        id: tools.id
        page: tools.page
        per_page: tools.per_page
        ref: tools.ref
        order_by: tools.order_by
        sort: tools.sort
      outputParameters:
      - type: object
        mapping: $.
    - name: get-repository-health
      description: Get repository health
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositoryhealth
      with:
        id: tools.id
        generate: tools.generate
      outputParameters:
      - type: object
        mapping: $.
    - name: get-common-ancestor-between-commits
      description: Get the common ancestor between commits
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositorymergebase
      with:
        id: tools.id
        refs: tools.refs
      outputParameters:
      - type: object
        mapping: $.
    - name: get-project-repository-tree
      description: Get a project repository tree
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: gitlab-ci-repositories.getapiv4projectsidrepositorytree
      with:
        id: tools.id
        ref: tools.ref
        path: tools.path
        recursive: tools.recursive
        page: tools.page
        per_page: tools.per_page
        pagination: tools.pagination
        page_token: tools.page_token
      outputParameters:
      - type: object
        mapping: $.