Merge Requests

July 19, 2026 · View on GitHub

MR lifecycle — create, update, merge, approve, plus diff/conflict inspection and the full discussion/note/draft API.

Tools in this group


merge_merge_request

✏️ Writes

Merge a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
auto_mergebooleanIf true, the merge request merges when the pipeline succeeds.
merge_commit_messagestringCustom merge commit message
merge_when_pipeline_succeedsbooleanIf true, the merge request merges when the pipeline succeeds. Deprecated in GitLab 17.11. Use auto_merge instead.
should_remove_source_branchbooleanRemove source branch after merge
squash_commit_messagestringCustom squash commit message
squashbooleanSquash commits into a single commit when merging

approve_merge_request

✏️ Writes

Approve a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of the merge request to approve
shastringThe HEAD of the merge request. Optional, but used to ensure the merge request hasn't changed since you last reviewed it
approval_passwordstringCurrent user's password. Required if 'Require user re-authentication to approve' is enabled in the project settings

unapprove_merge_request

✏️ Writes

Unapprove a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of the merge request to unapprove

get_merge_request_approval_state

📖 Read-only

Get merge request approval details including approvers

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of the merge request

get_branch

📖 Read-only

Get branch details (commit, protection status)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
branch_namestringName of the branch

list_branches

📖 Read-only

List branches in project with search filter

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
searchstringSearch term to filter branches by name
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

get_merge_request_conflicts

📖 Read-only

Get the conflicts of a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of the merge request

list_merge_request_pipelines

📖 Read-only

List pipelines for a merge request with pagination

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe internal ID of the merge request
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

get_merge_request

📖 Read-only

Get details of a merge request (mergeRequestIid or branchName required). Set include_summaries=true for deployment/commit/approval summaries

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
include_summariesbooleanIf true, include deployment_summary, commit_addition_summary and approval_summary (extra API calls, larger response). Default false to reduce token usage.

get_merge_request_diffs

📖 Read-only

Get the changes/diffs of a merge request (mergeRequestIid or branchName required)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
viewenum (inline | parallel)Diff view type
excluded_file_patternsarrayArray of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: ["^vendor/", "^test/mocks/", ".spec.ts$", "package-lock.json"]

list_merge_request_changed_files

📖 Read-only

List changed file paths in a merge request without diff content (mergeRequestIid or branchName required)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
excluded_file_patternsarrayArray of regex patterns to exclude files. Examples: ["^vendor/", ".pb.go$"]

list_merge_request_diffs

📖 Read-only

List merge request diffs with pagination (mergeRequestIid or branchName required)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)
unidiffbooleanPresent diffs in the unified diff format. Default is false. Introduced in GitLab 16.5.

get_merge_request_file_diff

📖 Read-only

Get diffs for specific files from a merge request (mergeRequestIid or branchName required)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
file_pathsarrayList of file paths to retrieve diffs for (e.g. ['src/api/users.ts', 'src/repo/user.go']). Call list_merge_request_changed_files first to get the full list of changed paths.
unidiffbooleanPresent diff in the unified diff format. Default is false.

list_merge_request_versions

📖 Read-only

List all versions of a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe internal ID of the merge request

get_merge_request_version

📖 Read-only

Get a specific version of a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe internal ID of the merge request
version_idstringThe ID of the merge request diff version
unidiffbooleanPresent diffs in the unified diff format. Default is false. Introduced in GitLab 16.5.

update_merge_request

✏️ Writes

Update a merge request (mergeRequestIid or branchName required)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
source_branchstringSource branch name
titlestringThe title of the merge request
descriptionstringThe description of the merge request
target_branchstringThe target branch
assignee_idsarrayThe ID of the users to assign the MR to
reviewer_idsarrayThe ID of the users to assign as reviewers of the MR
labelsarrayLabels for the MR
state_eventenum (close | reopen)New state (close/reopen) for the MR
remove_source_branchbooleanFlag indicating if the source branch should be removed
squashbooleanSquash commits into a single commit when merging
draftbooleanWork in progress merge request
milestone_idstringMilestone ID to assign. Set to 0 to unassign. Null is treated as omitted.

create_merge_request

✏️ Writes

Create a new merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
titlestringMerge request title
descriptionstringMerge request description
source_branchstringBranch containing changes
target_branchstringBranch to merge into
target_project_idstringNumeric ID of the target project.
assignee_idsarrayThe ID of the users to assign the MR to
reviewer_idsarrayThe ID of the users to assign as reviewers of the MR
labelsarrayLabels for the MR
draftbooleanCreate as draft merge request
allow_collaborationbooleanAllow commits from upstream members
remove_source_branchboolean | nullFlag indicating if a merge request should remove the source branch when merging.
squashboolean | nullIf true, squash all commits into a single commit on merge.

list_merge_requests

📖 Read-only

List merge requests (without project_id: user's MRs; with project_id: project MRs)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or URL-encoded path (optional - if not provided, lists all merge requests the user has access to)
assignee_idstringReturn MRs assigned to the given user ID (integer), 'none', or 'any'. Mutually exclusive with assignee_username.
assignee_usernamestringReturns merge requests assigned to the given username. Mutually exclusive with assignee_id.
author_idstringReturns merge requests created by the given user ID (integer). Mutually exclusive with author_username.
author_usernamestringReturns merge requests created by the given username. Mutually exclusive with author_id.
reviewer_idstringReturns merge requests which have the user as a reviewer. Must be an integer, 'none', or 'any'. Mutually exclusive with reviewer_username.
reviewer_usernamestringReturns merge requests which have the user as a reviewer by username. Mutually exclusive with reviewer_id.
approved_by_usernamesarrayReturns merge requests approved by the given usernames (array).
created_afterstringReturn merge requests created after the given time
created_beforestringReturn merge requests created before the given time
updated_afterstringReturn merge requests updated after the given time
updated_beforestringReturn merge requests updated before the given time
labelsarrayArray of label names
milestonestringMilestone title
scopeenum (created_by_me | assigned_to_me | all)Return merge requests from a specific scope
searchstringSearch for specific terms
stateenum (opened | closed | locked | merged | all)Return merge requests with a specific state
order_byenum (created_at | updated_at | priority | label_priority | milestone_due | popularity)Return merge requests ordered by the given field
sortenum (asc | desc)Return merge requests sorted in ascending or descending order
target_branchstringReturn merge requests targeting a specific branch
source_branchstringReturn merge requests from a specific source branch
wipenum (yes | no)Filter merge requests against their wip status
with_labels_detailsbooleanReturn more details for each label
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

get_branch_diffs

📖 Read-only

Get diffs between two branches or commits

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
fromstringThe base branch or commit SHA to compare from
tostringThe target branch or commit SHA to compare to
straightbooleanComparison method: false for '...' (default), true for '--'
excluded_file_patternsarrayArray of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: ["^vendor/", "^test/mocks/", ".spec.ts$", "package-lock.json"]

mr_discussions

📖 Read-only

List discussion items for a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of items per page (max: 100, default: 20)

create_merge_request_note

✏️ Writes

Add a new note to a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
bodystringThe content of the note or reply

update_merge_request_note

✏️ Writes

Modify an existing merge request note

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a thread note
bodystringThe content of the note or reply

delete_merge_request_note

✏️ Writes

Delete an existing merge request note

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a thread note

get_merge_request_note

📖 Read-only

Get a specific note for a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a thread note

get_merge_request_notes

📖 Read-only

List notes for a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
sortenum (asc | desc)The sort order of the notes
order_byenum (created_at | updated_at)The field to sort the notes by
per_pagenumberNumber of items per page
pagenumberPage number for pagination

delete_merge_request_discussion_note

✏️ Writes

Delete a discussion note on a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
discussion_idstringThe ID of a thread
note_idstringThe ID of a thread note

update_merge_request_discussion_note

✏️ Writes

Update a discussion note on a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
discussion_idstringThe ID of a thread
note_idstringThe ID of a thread note
bodystringThe content of the note or reply
resolvedbooleanResolve or unresolve the note

create_merge_request_discussion_note

✏️ Writes

Add a new discussion note to an existing merge request thread

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
discussion_idstringThe ID of a thread
bodystringThe content of the note or reply
created_atstringDate the note was created at (ISO 8601 format)

get_draft_note

📖 Read-only

Get a single draft note from a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
draft_note_idstringThe ID of the draft note

list_draft_notes

📖 Read-only

List draft notes for a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request

create_draft_note

✏️ Writes

Create a draft note for a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
bodystringThe content of the draft note
in_reply_to_discussion_idstringThe ID of a discussion the draft note replies to
positionobjectPosition when creating a diff note
resolve_discussionbooleanWhether to resolve the discussion when publishing

update_draft_note

✏️ Writes

Update an existing draft note

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
draft_note_idstringThe ID of the draft note
bodystringThe content of the draft note
positionobjectPosition when creating a diff note
resolve_discussionbooleanWhether to resolve the discussion when publishing

delete_draft_note

✏️ Writes

Delete a draft note

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
draft_note_idstringThe ID of the draft note

publish_draft_note

✏️ Writes

Publish a single draft note

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
draft_note_idstringThe ID of the draft note

bulk_publish_draft_notes

✏️ Writes

Publish all draft notes for a merge request. Optionally sets reviewer_state and posts a summary note (GitLab 19.2+). Can set reviewer_state even with no drafts.

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
reviewer_stateenum (requested_changes | reviewed)Set reviewer review state after publishing (GitLab 19.2+). Does not record a formal approval. Works even with no draft notes.
notestringSummary note body to post on the merge request (GitLab 19.2+)
internalbooleanIf true, the summary note is internal (GitLab 19.2+, default false)

create_merge_request_thread

✏️ Writes

Create a new thread on a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
bodystringThe content of the thread
positionobjectPosition when creating a diff note
created_atstringDate the thread was created at (ISO 8601 format)

resolve_merge_request_thread

✏️ Writes

Resolve a thread on a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
discussion_idstringThe ID of a thread
resolvedbooleanWhether to resolve the thread

list_merge_request_emoji_reactions

📖 Read-only

List all emoji reactions on a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request

list_merge_request_note_emoji_reactions

📖 Read-only

List all emoji reactions on a merge request note. Pass discussion_id for discussion thread replies.

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a note (comment or thread reply)
discussion_idstringThe ID of a discussion thread. Required for notes that are discussion replies; omit for top-level notes.

create_merge_request_emoji_reaction

✏️ Writes

Add an emoji reaction to a merge request (e.g. thumbsup, rocket, eyes)

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
namestringName of the emoji without colons (e.g. 'thumbsup', 'rocket', 'eyes')

delete_merge_request_emoji_reaction

✏️ Writes

Remove an emoji reaction from a merge request

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
award_idstringThe ID of the emoji reaction to delete

create_merge_request_note_emoji_reaction

✏️ Writes

Add an emoji reaction to a merge request note. Pass discussion_id for discussion thread replies.

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a note (comment or thread reply)
discussion_idstringThe ID of a discussion thread. Required for notes that are discussion replies; omit for top-level notes.
namestringName of the emoji without colons (e.g. 'thumbsup', 'rocket', 'eyes')

delete_merge_request_note_emoji_reaction

✏️ Writes

Remove an emoji reaction from a merge request note. Pass discussion_id for discussion thread replies.

Parameters

ParameterTypeRequiredDescription
project_idstringProject ID or complete URL-encoded path to project
merge_request_iidstringThe IID of a merge request
note_idstringThe ID of a note (comment or thread reply)
discussion_idstringThe ID of a discussion thread. Required for notes that are discussion replies; omit for top-level notes.
award_idstringThe ID of the emoji reaction to delete