Skip to main content
Glama

Merge Request

gitlab_merge_request
Destructive

Create, update, merge, and approve GitLab merge requests. Manage approval rules, time tracking, dependencies, todos, and related issues.

Instructions

Use {"action":"approval_config","params":{...}}; only top-level keys are action and params. Action params schema: 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. This envelope schema stays broad; runtime validation applies the chosen action's schema after reserved meta keys like `confirm` are stripped. 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?

Discloses destructive behavior ('Delete permanently removes an MR') matching destructiveHint. Explains error conditions (404, 403, 405/409) with troubleshooting hints. Description aligns with annotations and adds useful behavioral context.

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

Conciseness5/5

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

Despite its length, the description is well-organized with sections for overview, usage, errors, and detailed action categories. Every sentence adds value, and the structure makes information easily navigable for an AI agent.

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?

Covers all aspects: action types, return values, error handling, parameter conventions, and special notes. Given the tool's complexity (60+ actions) and presence of output schema, the description is thoroughly complete.

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?

Schema coverage is 100%, and the description adds substantial value by listing per-action required and optional parameters with examples and important notes (e.g., default branch retrieval). This is far beyond baseline 3.

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 the tool manages GitLab merge request lifecycle and many related aspects. It uses specific verbs like 'Manage', 'Open/list/update/merge/close/delete/rebase', and explicitly distinguishes from siblings by stating 'NOT for: comments, discussions, diffs... use gitlab_mr_review'.

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?

Provides explicit when-to-use ('MR lifecycle...') and when-not-to-use ('NOT for: ...') guidance, names alternative tools, and includes critical usage notes like retrieving default branch for create and auto-detection for merge.

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