Skip to content

Repository files and commits

What a repository holds: browse its tree, read a file raw or with its metadata, its blame and its history, and create, update or delete one; read blobs; compare two refs and find their merge base; download an archive; list contributors; generate or add a changelog.

Commits: list, read and create them, read a commit’s diff, refs, merge requests and signature, cherry-pick and revert one, set and read commit statuses, and comment on a commit or hold a threaded discussion on it. Submodules can be listed, read into and updated, and Markdown can be rendered as GitLab renders it.

  • “Show the file tree of project 42”
  • “Get the contents of README.md on main”
  • “Compare main and develop”
  • “Who last changed line 120 of src/server.go?”
  • Dynamic, the default surface: call gitlab_execute_action with action set to the action’s ID, such as repository.archive, 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_repository with action set to the action’s name, such as archive, and its parameters in params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): call the action’s own tool, such as gitlab_repository_archive, with its parameters as the arguments.

Every tier serves the whole group, on self-managed instances and on GitLab.com alike.

Read-only actions: 27 of 41, the ones a deployment in read-only mode keeps. A token with read_api and not api is served 27 of the 41.

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. A destructive action runs only once confirmed, unless GITLAB_MCP_YOLO_MODE (or AUTOPILOT) skips that step: the dynamic surface needs confirm: true on gitlab_execute_action, and the other two take a confirm parameter or the client’s prompt (Destructive actions).

Action Individual
repository.archive gitlab_repository_archive
repository.blob gitlab_repository_blob
repository.changelog_add gitlab_repository_changelog_add
repository.changelog_generate gitlab_repository_changelog_generate
repository.commit_cherry_pick gitlab_commit_cherry_pick
repository.commit_comment_create gitlab_commit_comment_create
repository.commit_comments gitlab_commit_comments
repository.commit_create gitlab_commit_create
repository.commit_diff gitlab_commit_diff
repository.commit_discussion_add_note gitlab_add_commit_discussion_note
repository.commit_discussion_create gitlab_create_commit_discussion
repository.commit_discussion_delete_note gitlab_delete_commit_discussion_note
repository.commit_discussion_get gitlab_get_commit_discussion
repository.commit_discussion_list gitlab_list_commit_discussions
repository.commit_discussion_update_note gitlab_update_commit_discussion_note
repository.commit_get gitlab_commit_get
repository.commit_list gitlab_commit_list
repository.commit_merge_requests gitlab_commit_merge_requests
repository.commit_refs gitlab_commit_refs
repository.commit_revert gitlab_commit_revert
repository.commit_signature gitlab_commit_signature
repository.commit_status_set gitlab_commit_status_set
repository.commit_statuses gitlab_commit_statuses
repository.compare gitlab_repository_compare
repository.contributors gitlab_repository_contributors
repository.file_blame gitlab_file_blame
repository.file_create gitlab_file_create
repository.file_delete gitlab_file_delete
repository.file_get gitlab_file_get
repository.file_history gitlab_commit_list
repository.file_metadata gitlab_file_metadata
repository.file_raw gitlab_file_raw
repository.file_raw_metadata gitlab_file_raw_metadata
repository.file_update gitlab_file_update
repository.list_submodules gitlab_list_repository_submodules
repository.markdown_render gitlab_render_markdown
repository.merge_base gitlab_repository_merge_base
repository.raw_blob gitlab_repository_raw_blob
repository.read_submodule_file gitlab_read_repository_submodule_file
repository.tree gitlab_repository_tree
repository.update_submodule gitlab_update_repository_submodule

Build the download URL for a repository archive. Returns: the project, ref/SHA, format, the subdirectory when one was asked for, and the archive download URL (binary content is not returned). See also: repository.tree, tag.list.

  • Meta-tool: gitlab_repository, action archive
  • Individual tool: gitlab_repository_archive
  • Tier: Free
  • Classic or OAuth token: read_api (or api); the action sends GitLab no request
  • Fine-grained token: no permission (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
format string no Archive format: tar.gz, tar.bz2, tbz, tbz2, tb2, bz2, tar, zip (default: tar.gz)
path string no Subdirectory path to archive (omit for entire repo)
sha string no Commit SHA, branch, or tag to archive (default: default branch)

Get a git blob by SHA. Returns: blob SHA, byte size, decoded text content (or image data), and a content category (text/image/binary). See also: repository.raw_blob, repository.tree.

  • Meta-tool: gitlab_repository, action blob
  • Individual tool: gitlab_repository_blob
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Blob SHA (from tree listing or commit diff)

Add changelog data to a changelog file by committing the generated entries. Returns: a success confirmation with the version. See also: repository.changelog_generate, release.create.

  • Meta-tool: gitlab_repository, action changelog_add
  • Individual tool: gitlab_repository_changelog_add
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Repository: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
version string yes Version of the release the changelog is for, in semantic versioning format such as 1.0.0. GitLab requires a MAJOR.MINOR.PATCH version in the value, so v1.0.0 and 1.0.0-rc.1 are taken and 1.0 is not
branch string no Branch to commit the changelog to (default: default branch)
config_file string no Path to the changelog config file in the project
date string no Date and time of the release, an ISO 8601 timestamp such as 2026-03-01T10:00:00Z. A date such as 2026-03-01 is read as midnight UTC (default: the current time)
file string no Path to the changelog file (default: CHANGELOG.md)
from string no Start of the range (commit SHA or tag)
message string no Commit message for the changelog update
to string no End of the range (commit SHA or tag, default: HEAD)
trailer string no Git trailer to use for changelog generation (default: Changelog)

Generate changelog notes for a version range without committing. Returns: the rendered changelog notes (read-only preview). See also: repository.changelog_add, release.create.

  • Meta-tool: gitlab_repository, action changelog_generate
  • Individual tool: gitlab_repository_changelog_generate
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
version string yes Version of the release the notes are for, in semantic versioning format such as 1.0.0. GitLab requires a MAJOR.MINOR.PATCH version in the value, so v1.0.0 and 1.0.0-rc.1 are taken and 1.0 is not
config_file string no Path to the changelog config file
date string no Date and time of the release, an ISO 8601 timestamp such as 2026-03-01T10:00:00Z. A date such as 2026-03-01 is read as midnight UTC (default: the current time)
from string no Start of the range (commit SHA or tag)
to string no End of the range (commit SHA or tag, default: HEAD)
trailer string no Git trailer to use (default: Changelog)

Cherry-pick a commit onto a target branch, optionally as a dry run. Returns: the newly created commit (SHA, title, author, dates, web URL) or a conflict error. See also: repository.commit_get, branch.list, repository.commit_revert.

  • Meta-tool: gitlab_repository, action commit_cherry_pick
  • Individual tool: gitlab_commit_cherry_pick
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
branch string yes Target branch name
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA to cherry-pick
dry_run boolean no If true, does not create the commit but checks for conflicts
message string no Custom commit message (defaults to original)

Post a comment on a commit, optionally inline on a specific file path and line. Returns: the created comment with note text, author user object, and optional path/line/line_type. See also: repository.commit_comments, repository.commit_diff, repository.commit_get.

  • Meta-tool: gitlab_repository, action commit_comment_create
  • Individual tool: gitlab_commit_comment_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Update at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
note string yes Comment text
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA
line integer no Line number to comment on
line_type string (new, old) no Line type: new or old (default: new)
path string no File path to comment on (for inline comments)

List the comments on a commit. Returns: comment entries with note text, author user object, optional file path, line, and line type, plus pagination metadata. See also: repository.commit_comment_create, repository.commit_get, repository.commit_diff.

  • Meta-tool: gitlab_repository, action commit_comments
  • Individual tool: gitlab_commit_comments
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA
order_by string no Column to order results by
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 order: ‘asc’ or ‘desc’

Create a commit with multiple file actions (create/update/delete/move/chmod) on a branch in one call. Creating it with force requires confirmation. Returns: the created commit with SHA, title, author/committer, dates, parent IDs, stats, trailers, and web URL. See also: branch.list, repository.tree, repository.commit_get.

  • Meta-tool: gitlab_repository, action commit_create
  • Individual tool: gitlab_commit_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
actions object[] yes List of file actions (create, update, delete, move, chmod)
branch string yes Target branch name
commit_message string yes Commit message
project_id string/integer yes Project ID or URL-encoded path
author_email string no Custom author email
author_name string no Custom author name
confirm boolean no Confirms creating the commit with force, which drops from the target branch the commits its starting point does not have. Pass true only after the user approves that. Only required when force is true. Without it, a client that supports elicitation is asked. With it, or when the server runs in YOLO mode, nobody is asked
force boolean no When true, reset the target branch to the starting point (start_branch or start_sha) plus this commit, dropping from the branch the commits the starting point does not have. Needs the user’s approval: confirm=true once they approve, or an elicitation prompt
start_branch string no Branch to start from if target branch does not exist
start_project string no Project ID or path of the source project to start the branch from (for cross-project commits)
start_sha string no SHA to start from if target branch does not exist (alternative to start_branch)
stats boolean no Include commit stats (additions, deletions, total) in the response

Get the file diffs of a single commit, optionally in unified-diff format. Returns: per-file diffs (old/new path, diff body, new/renamed/deleted flags, file modes) with pagination metadata. See also: repository.commit_get, repository.file_history, repository.commit_comments.

  • Meta-tool: gitlab_repository, action commit_diff
  • Individual tool: gitlab_commit_diff
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA hash to get diffs for
order_by string no Column to order results by
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 order: ‘asc’ or ‘desc’
unidiff boolean no Return diffs in unified diff format

Add a reply note to an existing commit discussion thread. Returns: the created note (author, body, timestamps, resolvable state). See also: repository.commit_discussion_create, repository.commit_discussion_get, repository.commit_discussion_update_note.

  • Meta-tool: gitlab_repository, action commit_discussion_add_note
  • Individual tool: gitlab_add_commit_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
body string yes Note body (Markdown supported)
commit_sha string yes Commit SHA
discussion_id string yes Discussion ID to reply to
project_id string/integer yes Project ID or URL-encoded path
created_at string no Backdate the note creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights

Create a new discussion thread on a commit, optionally as an inline diff comment. Returns: the created thread with its first note (author, body, resolvable state, diff position). See also: repository.commit_discussion_add_note, repository.commit_discussion_list, repository.commit_diff.

  • Meta-tool: gitlab_repository, action commit_discussion_create
  • Individual tool: gitlab_create_commit_discussion
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
body string yes Discussion body (Markdown supported)
commit_sha string yes Commit SHA
project_id string/integer yes Project ID or URL-encoded path
created_at string no Backdate the discussion creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights
position object no Position for inline diff comments

Delete a note from a commit discussion thread (destructive). Returns: a deletion confirmation message. See also: repository.commit_discussion_update_note, repository.commit_discussion_get, repository.commit_discussion_list.

  • Meta-tool: gitlab_repository, action commit_discussion_delete_note
  • Individual tool: gitlab_delete_commit_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
commit_sha string yes Commit SHA
discussion_id string yes Discussion ID
note_id integer yes Note ID to delete
project_id string/integer yes Project ID or URL-encoded path

Get a single commit discussion thread by its discussion id. Returns: the thread with every note (author, body, system flag, resolvable/resolved state, diff position). See also: repository.commit_discussion_list, repository.commit_discussion_add_note, repository.commit_get.

  • Meta-tool: gitlab_repository, action commit_discussion_get
  • Individual tool: gitlab_get_commit_discussion
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
commit_sha string yes Commit SHA
discussion_id string yes Discussion ID
project_id string/integer yes Project ID or URL-encoded path

List discussion threads on a commit with ordering and offset pagination. Returns: discussion threads with their notes (author, body, system flag, resolvable state, diff position) and pagination metadata. See also: repository.commit_discussion_get, repository.commit_discussion_create, repository.commit_get.

  • Meta-tool: gitlab_repository, action commit_discussion_list
  • Individual tool: gitlab_list_commit_discussions
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
commit_sha string yes Commit SHA
project_id string/integer yes Project ID or URL-encoded path
order_by string no Column to order results by (e.g. 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 or desc)

Update the body of a note in a commit discussion thread. Returns: the updated note (author, body, timestamps). See also: repository.commit_discussion_add_note, repository.commit_discussion_delete_note, repository.commit_discussion_get.

  • Meta-tool: gitlab_repository, action commit_discussion_update_note
  • Individual tool: gitlab_update_commit_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Update at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
body string yes Updated note body
commit_sha string yes Commit SHA
discussion_id string yes Discussion ID
note_id integer yes Note ID to update
project_id string/integer yes Project ID or URL-encoded path
created_at string no Override the note creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights

Get a single commit from a project by SHA (full, short, branch, or tag). Returns: full commit metadata, message, parent IDs, author/committer, dates, stats, trailers, project ID, and last pipeline. See also: repository.file_history, repository.commit_diff, repository.commit_refs, repository.commit_statuses.

  • Meta-tool: gitlab_repository, action commit_get
  • Individual tool: gitlab_commit_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA hash to retrieve
stats boolean no Include commit stats (additions, deletions, total). Defaults to true on GitLab

List repository commits for a project, optionally filtered by ref_name, since/until, path, or author. Returns: commit summaries (SHA, title, author, dates, parent IDs, stats, trailers, last pipeline) with pagination metadata. See also: repository.commit_get, repository.commit_diff, repository.commit_statuses, branch.list.

  • Meta-tool: gitlab_repository, action commit_list
  • Individual tool: gitlab_commit_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
all boolean no Retrieve every commit from the whole repository (across all branches)
author string no Filter by commit author name or email
first_parent boolean no Follow only the first parent commit upon seeing a merge commit
order_by string no For keyset pagination, the column to order results by
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.
path string no File path to filter commits by (only commits touching this path)
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.
ref_name string no Branch name, tag, or commit SHA to list commits from (default: default branch)
since string no Return commits after this date (ISO 8601 format, e.g. 2025-01-01T00:00:00Z)
sort string (asc, desc) no Sort order for keyset pagination: ‘asc’ or ‘desc’
trailers boolean no Parse and include Git trailers for every commit
until string no Return commits before this date (ISO 8601 format, e.g. 2025-12-31T23:59:59Z)
with_stats boolean no Include commit stats (additions, deletions, total)

List merge requests associated with a commit. Returns: compact MR rows with IID, project, title, state, draft flag, source/target branches, merge commit SHA, labels, author, web URL, and created, updated, merged and closed times, with pagination metadata. See also: repository.commit_get, merge_request.get, mr_review.changes_get.

  • Meta-tool: gitlab_repository, action commit_merge_requests
  • Individual tool: gitlab_commit_merge_requests
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA
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.

List branches and tags that reference (contain) a commit, optionally filtered by ref type. Returns: ref entries with type and name plus pagination metadata. See also: repository.commit_get, branch.list, tag.list.

  • Meta-tool: gitlab_repository, action commit_refs
  • Individual tool: gitlab_commit_refs
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA to look up
order_by string no Column to order results by
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 order: ‘asc’ or ‘desc’
type string (branch, tag, all) no Filter by ref type: branch, tag, or all (default: all)

Revert a commit on a target branch, creating a new commit that undoes it. Returns: the newly created revert commit (SHA, title, author, dates, web URL) or a conflict error. See also: repository.commit_get, branch.list, repository.commit_cherry_pick.

  • Meta-tool: gitlab_repository, action commit_revert
  • Individual tool: gitlab_commit_revert
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
branch string yes Target branch name
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA to revert

Get the signature (GPG/X.509/SSH) of a commit for authenticity verification. Returns: the signing key ID, primary key ID, signer name/email, verification status, and optional subkey ID. See also: repository.commit_get, repository.file_history.

  • Meta-tool: gitlab_repository, action commit_signature
  • Individual tool: gitlab_commit_signature
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA

Set or update the pipeline status of a commit (used by external CI/reporting integrations). Returns: the resulting status with state, name, ref, coverage, pipeline ID, timestamps, and author user object. See also: repository.commit_statuses, repository.commit_get, pipeline.list.

  • Meta-tool: gitlab_repository, action commit_status_set
  • Individual tool: gitlab_commit_status_set
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Commit Status: Create at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Commit SHA
state string (pending, running, success, failed, canceled, skipped) yes Status state: pending, running, success, failed, canceled
context string no Status context label (overrides name)
coverage number no Code coverage percentage
description string no Short description of the status
name string no Status name / context
pipeline_id integer no Pipeline ID to associate the status with
ref string no Branch or tag name
target_url string no URL to link from the status

List the statuses of a commit (CI jobs and external integrations), filtered by ref, stage, name, or pipeline. Returns: status entries with state, name, ref, coverage, pipeline ID, timestamps, and author user object, plus pagination metadata. See also: repository.commit_status_set, repository.commit_get, pipeline.list.

  • Meta-tool: gitlab_repository, action commit_statuses
  • Individual tool: gitlab_commit_statuses
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Full commit SHA, 40 hex characters or 64 in a SHA-256 repository. GitLab lists the statuses of the pipelines that ran on exactly this SHA, so a branch name or an abbreviated SHA lists none
all boolean no Return all statuses including retries
name string no Status name filter
order_by string no Column to order results by
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.
pipeline_id integer no Pipeline ID filter
ref string no Branch or tag name filter
sort string (asc, desc) no Sort order: ‘asc’ or ‘desc’
stage string no Stage name filter

Compare two refs (branches, tags, or commits) in a project. Use from_project_id for cross-project comparison. Returns: commits, diffs, and comparison metadata. See also: repository.tree, branch.list.

  • Meta-tool: gitlab_repository, action compare
  • Individual tool: gitlab_repository_compare
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
from string yes Branch name, tag, or commit SHA to compare from
project_id string/integer yes Project ID or URL-encoded path
to string yes Branch name, tag, or commit SHA to compare to
from_project_id integer no Source project ID for cross-project comparison, minimum=1
straight boolean no Use straight comparison (from..to) instead of merge-base (from…to)
unidiff boolean no Return diffs in unified diff format

List repository contributors. Returns: each contributor’s name, email, commit count, additions, deletions, and pagination metadata. See also: repository.tree, repository.file_history.

  • Meta-tool: gitlab_repository, action contributors
  • Individual tool: gitlab_repository_contributors
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
order_by string (name, email, commits) no Order by: name, email, or commits (number of commits). Contributors are ordered by commit date when omitted
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 or desc (default: asc)

Get blame information for a file, optionally for a line range. Returns: file_path and blame ranges, each with commit id, message, author name/email, authored and committed dates, and the covered lines. See also: repository.file_get, repository.file_history.

  • Meta-tool: gitlab_repository, action file_blame
  • Individual tool: gitlab_file_blame
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Full path of the file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
ref string yes Branch, tag, or commit SHA
range_end integer no End line number for blame range
range_start integer no Start line number for blame range

Create a new file in a repository in a single commit. Returns: file_path, branch, commit_id, and last_commit_id. See also: repository.file_update, repository.file_get, repository.file_delete.

  • Meta-tool: gitlab_repository, action file_create
  • Individual tool: gitlab_file_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Repository: Create at project. Some calls also need: Repository: Read at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
branch string yes Branch to create the file on
commit_message string yes Commit message
content string yes File content
file_path string yes Full path of the new file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
author_email string no Commit author email
author_name string no Commit author name
encoding string (text, base64) no Content encoding: text or base64 (default: text)
execute_filemode boolean no Enable execute permission on the file
start_branch string no Branch to start from (creates new branch if different from branch)

Delete a file from a repository in a single commit. Returns: a success confirmation naming the file and project. See also: repository.file_get, repository.file_update.

  • Meta-tool: gitlab_repository, action file_delete
  • Individual tool: gitlab_file_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Repository: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
branch string yes Branch to delete the file from
commit_message string yes Commit message
file_path string yes Full path of the file to delete, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
author_email string no Commit author email
author_name string no Commit author name
last_commit_id string no Last known commit ID for optimistic locking
start_branch string no Branch to start from

Get a single file’s decoded content and metadata from a repository. Returns: file_name, file_path, size, encoding, content, content_sha256, ref, blob_id, commit_id, last_commit_id, and execute_filemode. See also: repository.file_raw, repository.file_metadata, repository.file_blame, repository.tree.

  • Meta-tool: gitlab_repository, action file_get
  • Individual tool: gitlab_file_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Full path of the file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
ref string yes Branch name, tag, or commit SHA

List repository commits for a project, optionally filtered by ref_name, since/until, path, or author. Returns: commit summaries (SHA, title, author, dates, parent IDs, stats, trailers, last pipeline) with pagination metadata. See also: repository.commit_get, repository.commit_diff, repository.commit_statuses, branch.list.

  • Meta-tool: gitlab_repository, action file_history
  • Individual tool: gitlab_commit_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Commit: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
all boolean no Retrieve every commit from the whole repository (across all branches)
author string no Filter by commit author name or email
first_parent boolean no Follow only the first parent commit upon seeing a merge commit
order_by string no For keyset pagination, the column to order results by
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.
path string no File path to filter commits by (only commits touching this path)
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.
ref_name string no Branch name, tag, or commit SHA to list commits from (default: default branch)
since string no Return commits after this date (ISO 8601 format, e.g. 2025-01-01T00:00:00Z)
sort string (asc, desc) no Sort order for keyset pagination: ‘asc’ or ‘desc’
trailers boolean no Parse and include Git trailers for every commit
until string no Return commits before this date (ISO 8601 format, e.g. 2025-12-31T23:59:59Z)
with_stats boolean no Include commit stats (additions, deletions, total)

Get a file’s metadata without content (HEAD request). Returns: file_name, file_path, size, encoding, ref, blob_id, commit_id, last_commit_id, execute_filemode, and content_sha256. See also: repository.file_get, repository.file_raw_metadata.

  • Meta-tool: gitlab_repository, action file_metadata
  • Individual tool: gitlab_file_metadata
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Full path of the file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
ref string yes Branch, tag, or commit SHA

Get the raw content of a file from a repository. Returns: file_path, size, content, and content_category. See also: repository.file_get, repository.file_raw_metadata.

  • Meta-tool: gitlab_repository, action file_raw
  • Individual tool: gitlab_file_raw
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Full path of the file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
lfs boolean no Fetch the target of an LFS pointer instead of the pointer file itself
ref string no Branch, tag, or commit SHA (defaults to default branch)

Get raw file metadata without content (HEAD request to the raw endpoint). Returns: file_name, file_path, size, encoding, ref, blob_id, commit_id, last_commit_id, execute_filemode, and content_sha256. See also: repository.file_raw, repository.file_metadata.

  • Meta-tool: gitlab_repository, action file_raw_metadata
  • Individual tool: gitlab_file_raw_metadata
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Full path of the file in the repository, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
lfs boolean no Fetch the target of an LFS pointer instead of the pointer file itself
ref string no Branch, tag, or commit SHA (defaults to default branch)

Update an existing file in a repository in a single commit. Returns: file_path, branch, commit_id, and last_commit_id. See also: repository.file_create, repository.file_get, repository.file_delete.

  • Meta-tool: gitlab_repository, action file_update
  • Individual tool: gitlab_file_update
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Repository: Update at project. Some calls also need: Repository: Read at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
branch string yes Branch to update the file on
commit_message string yes Commit message
content string yes New file content
file_path string yes Full path of the file to update, as written (e.g. src/main.go)
project_id string/integer yes Project ID or URL-encoded path
author_email string no Commit author email
author_name string no Commit author name
encoding string (text, base64) no Content encoding: text or base64 (default: text)
execute_filemode boolean no Enable execute permission on the file
last_commit_id string no Last known commit ID for optimistic locking
start_branch string no Branch to start from

List the Git submodules defined in a repository’s .gitmodules. Returns: each submodule’s name, path, remote url, resolved_project on this instance, or external for a remote on another host and unresolved for one naming no project here, and pinned commit_sha, plus a count. See also: repository.read_submodule_file, repository.update_submodule, repository.tree.

  • Meta-tool: gitlab_repository, action list_submodules
  • Individual tool: gitlab_list_repository_submodules
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project. Some calls also need: Project: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
ref string no Branch name, tag, or commit SHA (defaults to default branch)

Render arbitrary Markdown text to HTML using the GitLab Markdown API. Optionally apply GitLab Flavored Markdown and resolve references within a project’s context. Returns: the rendered HTML string. See also: repository.file_get, wiki.get.

  • Meta-tool: gitlab_repository, action markdown_render
  • Individual tool: gitlab_render_markdown
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Markdown: Render at project or user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
text string yes Markdown text to render
gfm boolean no Use GitLab Flavored Markdown (default false)
project string no Project path for resolving references (e.g. group/project)

Find the common ancestor (merge base) of two or more refs. Returns: the merge-base commit with metadata and web URL. See also: repository.compare, branch.list.

  • Meta-tool: gitlab_repository, action merge_base
  • Individual tool: gitlab_repository_merge_base
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
refs string[] yes Two or more branch names, tags, or commit SHAs to find the merge base of

Get the raw content of a git blob by SHA. Returns: blob SHA, byte size, decoded text content (or image data), and a content category (text/image/binary). See also: repository.blob, repository.tree.

  • Meta-tool: gitlab_repository, action raw_blob
  • Individual tool: gitlab_repository_raw_blob
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
sha string yes Blob SHA (from tree listing or commit diff)

Read a file from inside a submodule at the parent-pinned commit. Returns: file_name, file_path, submodule_path, resolved_project, commit_sha, size, decoded content, and encoding. See also: repository.list_submodules, repository.file_get, repository.update_submodule.

  • Meta-tool: gitlab_repository, action read_submodule_file
  • Individual tool: gitlab_read_repository_submodule_file
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Project: Read at project; Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_path string yes Path of the file inside the submodule (e.g. src/main.c)
project_id string/integer yes Project ID or URL-encoded path of the parent repository
submodule_path string yes Path to the submodule as defined in .gitmodules (e.g. libs/core-module)
ref string no Branch/tag/SHA in the parent repository (defaults to default branch)

List repository tree items. Returns: paths, object IDs, entry types (blob/tree/commit), modes, each entry’s last commit when with_last_commit is set, and pagination metadata. See also: repository.blob, repository.raw_blob, branch.list.

  • Meta-tool: gitlab_repository, action tree
  • Individual tool: gitlab_repository_tree
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Repository: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
order_by string no Column to order keyset-paginated results by: ‘id’, ‘name’, ‘path’, or ‘type’ (only used with pagination=‘keyset’)
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.
path string no Path inside the repository to list (default: root)
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.
recursive boolean no List files recursively through subdirectories. Cannot be combined with with_last_commit
ref string no Branch name, tag, or commit SHA (default: default branch)
sort string (asc, desc) no Sort direction for keyset pagination: ‘asc’ or ‘desc’ (only used with pagination=‘keyset’)
with_last_commit boolean no Include, as last_commit, the most recent commit that changed each entry (GitLab 19.3 or later, and an older instance ignores it). Cannot be combined with recursive

Update a submodule pointer to a new commit SHA on a branch. Returns: the created commit with id, short_id, title, author and committer details, dates, parent_ids, message, status, project_id, trailers, last_pipeline, and web_url. See also: repository.list_submodules, repository.read_submodule_file, repository.commit_get.

  • Meta-tool: gitlab_repository, action update_submodule
  • Individual tool: gitlab_update_repository_submodule
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Repository Submodule: Update at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
branch string yes Branch name to commit the update to
commit_sha string yes Full commit SHA to update the submodule to
project_id string/integer yes Project ID or URL-encoded path
submodule string yes Full path of the submodule in the repository, as .gitmodules writes it (e.g. libs/dep)
commit_message string no Custom commit message (optional)