Skip to main content
Glama

Merge Request

gitlab_merge_request
Destructive

Manage GitLab merge request lifecycle and settings: create, update, merge, close, delete, approve, rebase, list, and track time. Configure approvals, dependencies, todos, emoji, and events.

Instructions

Example: {"action":"approval_config","params":{...}} For the params schema of any action, read the MCP resource gitlab://schema/meta/gitlab_merge_request/.

Manage GitLab merge request lifecycle plus approval rules and settings, time tracking, subscriptions, context commits, MR dependencies (blocking MRs), todos, related issues, award emoji, and resource events. Delete permanently removes an MR. When to use: MR lifecycle (open/list/update/merge/close/delete/rebase), approvals at MR/group/project level, time tracking, subscriptions, context commits, MR dependencies, todos, related issues, award emoji, MR resource events. NOT for: comments, discussions, diffs, draft notes, raw diffs (use gitlab_mr_review), CI pipelines (use gitlab_pipeline; use action 'pipelines' here only to LIST MR pipelines), branches/tags (use gitlab_branch / gitlab_tag), commits in the repo (use gitlab_repository).

Returns:

  • list / list_global / list_group / commits / pipelines / participants / reviewers / issues_closed / related_issues / dependencies_list / approval_rules / context_commits_list / event_list / emoji_list: arrays with pagination {page, per_page, total, next_page}.

  • get / create / update / approve / merge / rebase / approval_state / approval_config / approval_rule_create / approval_rule_update / approval_settings_* / dependency_create / create_todo: MR, dependency, todo or settings object.

  • time_estimate_set / spent_time_add / time_stats / time_estimate_reset / spent_time_reset: {time_estimate, total_time_spent, human_time_estimate, human_total_time_spent}.

  • subscribe / unsubscribe / cancel_auto_merge / create_pipeline: updated MR or pipeline object.

  • delete / unapprove / approval_reset / approval_rule_delete / context_commits_delete / dependency_delete / emoji_*_delete: {success, message}. Errors: 404 (hint: confirm project_id and merge_request_iid — merge_request_iid is project-scoped, not the global ID), 403 (hint: requires Reporter+ to comment, Developer+ to merge, configured approvers to approve), 405/409 on merge (hint: WIP/draft, unresolved threads, failing pipelines or pending approvals — see approval_state).

Param conventions: * = required. Most actions need project_id*, merge_request_iid*. List actions accept page, per_page.

IMPORTANT for create: target_branch* — if user doesn't specify, retrieve project's default_branch via gitlab_project get; do NOT assume 'main'. IMPORTANT for merge: auto-detects project squash/delete-branch settings — do NOT set squash or should_remove_source_branch unless user explicitly asks.

MR lifecycle:

  • create: project_id*, source_branch*, target_branch*, title*, description, assignee_id, assignee_ids, reviewer_ids, labels (comma-separated), milestone_id, remove_source_branch, squash, allow_collaboration, target_project_id (forks)

  • get: project_id*, merge_request_iid*

  • list: project_id*, state (opened/closed/merged/all), labels, not_labels, milestone, scope, search, source_branch, target_branch, author_username, draft, iids, created_after/before, updated_after/before, order_by, sort

  • list_global / list_group: same filters as list. list_group needs group_id* instead of project_id.

  • update: project_id*, merge_request_iid*, title, description, target_branch, assignee_id, assignee_ids, reviewer_ids, labels, add_labels, remove_labels, milestone_id, remove_source_branch, squash, discussion_locked, allow_collaboration, state_event (close/reopen)

  • merge: project_id*, merge_request_iid*, merge_commit_message, squash, should_remove_source_branch, auto_merge, sha, squash_commit_message

  • approve / unapprove / rebase / delete / participants / reviewers / create_pipeline / cancel_auto_merge: project_id*, merge_request_iid*

  • rebase also accepts: skip_ci

  • commits / pipelines / issues_closed: project_id*, merge_request_iid*

  • subscribe / unsubscribe: project_id*, merge_request_iid*

Approvals:

  • approval_state / approval_rules / approval_config / approval_reset: project_id*, merge_request_iid*

  • approval_rule_create: project_id*, merge_request_iid*, name*, approvals_required*, approval_project_rule_id, user_ids, group_ids

  • approval_rule_update: project_id*, merge_request_iid*, approval_rule_id*, name, approvals_required, user_ids, group_ids

  • approval_rule_delete: project_id*, merge_request_iid*, approval_rule_id*

  • approval_settings_group_get / approval_settings_group_update: group_id*. Update params: allow_author_approval, allow_committer_approval, allow_overrides_approver_list_per_mr, retain_approvals_on_push, require_reauthentication_to_approve

  • approval_settings_project_get / approval_settings_project_update: project_id*. Same params + selective_code_owner_removals.

Time tracking:

  • time_estimate_set / spent_time_add: project_id*, merge_request_iid*, duration* (e.g. '3h30m', '1w2d'). spent_time_add also accepts summary.

  • time_estimate_reset / spent_time_reset / time_stats: project_id*, merge_request_iid*

Context commits:

  • context_commits_list / context_commits_create / context_commits_delete: project_id*, merge_request_iid*. create/delete need commits ([]string)*.

MR dependencies (blocking MRs):

  • dependencies_list: project_id*, merge_request_iid* — list MRs that block this MR from merging.

  • dependency_create: project_id*, merge_request_iid*, blocking_merge_request_id* (global ID of the blocking MR).

  • dependency_delete: project_id*, merge_request_iid*, blocking_merge_request_id*.

Todos and related issues:

  • create_todo: project_id*, merge_request_iid* — add this MR to the authenticated user's to-do list.

  • related_issues: project_id*, merge_request_iid* — list issues mentioned or linked from the MR (paginated).

Award emoji:

  • emoji_mr_list / emoji_mr_create / emoji_mr_delete: project_id*, merge_request_iid*, name* (create), award_id* (get/delete)

  • emoji_mr_get: project_id*, merge_request_iid*, award_id*

  • emoji_mr_note_list / emoji_mr_note_create / emoji_mr_note_delete: project_id*, merge_request_iid*, note_id*, name* (create), award_id* (get/delete)

  • emoji_mr_note_get: project_id*, merge_request_iid*, note_id*, award_id*

Resource events:

  • event_mr_label_list / event_mr_label_get: project_id*, merge_request_iid*, label_event_id* (get)

  • event_mr_milestone_list / event_mr_milestone_get: project_id*, merge_request_iid*, milestone_event_id* (get)

  • event_mr_state_list / event_mr_state_get: project_id*, merge_request_iid*, state_event_id* (get)

See also: gitlab_mr_review (comments, discussions, diffs, raw diffs, draft notes), gitlab_pipeline, gitlab_branch, gitlab_issue (linked/related issue lifecycle)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform. Pick exactly one of the values in `enum`. Each action expects its own `params` object — see the tool description for the per-action parameter list.
paramsNoAction-specific parameters as a JSON object. Required and optional fields differ per action; consult this tool's description for the chosen action. Send only the fields documented for that action — unknown keys are rejected with a validation error (only reserved meta keys like `confirm` are stripped before validation). For the JSON Schema of a specific action's `params`, read the MCP resource `gitlab://schema/meta/{tool}/{action}` (replace placeholders with the tool name and the chosen action).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
next_stepsNoOptional. Suggested follow-up actions or tool calls for the LLM, contextual to the result.
paginationNoPresent on list actions. Use `has_more` and `next_page` to paginate through results.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide destructiveHint and openWorldHint. The description adds behavioral context such as 'Delete permanently removes an MR', error hints for 404/403/405/409, and notes on auto-detection in merge. It also discloses validation behavior for unknown keys. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is lengthy but well-structured with sections, examples, and bullet points. It is front-loaded with a usage example and purpose. While not extremely concise, every part serves a purpose given the number of actions and details needed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (60+ actions), annotations (destructiveHint, openWorldHint), schema coverage (100%), and the presence of an output schema description, the description covers all necessary aspects: lifecycle, approvals, time tracking, error handling, return types, and even references to external MCP resources for detailed schemas.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Though the input schema has high coverage with two parameters defined, the description provides extensive per-action parameter lists, required/optional markers, and important notes (e.g., 'IMPORTANT for create: target_branch*'). This adds critical meaning beyond the schema's generic description of 'params'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Manage GitLab merge request lifecycle plus approval rules and settings, time tracking, subscriptions, context commits, MR dependencies, todos, related issues, award emoji, and resource events.' It also explicitly distinguishes from sibling tools like gitlab_mr_review, gitlab_pipeline, etc., and notes that delete permanently removes an MR.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes explicit 'When to use' and 'NOT for' sections that list exactly when to use this tool versus alternatives. It also ends with 'See also' referencing other tools, providing clear guidance on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmrplens/gitlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server