Skip to main content
Glama

gitlab_merge_merge_request

Merge an approved GitLab merge request after meeting prerequisites like approvals and CI passing. Supports options for squash commits, branch deletion, and auto-merge on pipeline success.

Instructions

Merge an approved merge request Returns: Merge result with commit SHA Use when: MR is approved and ready Options: Squash, delete branch, auto-merge

Prerequisites:

  • No conflicts

  • Approvals met

  • CI passing (if required)

Related tools:

  • gitlab_get_merge_request: Check merge status

  • gitlab_approve_merge_request: Add approval

  • gitlab_rebase_merge_request: Fix conflicts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
mr_iidYesMerge request number (IID - Internal ID) Type: integer Format: Project-specific MR number (without !) Required: Yes Examples: - 456 (for MR !456) - 7890 (for MR !7890) How to find: Look at MR URL or title - URL: https://gitlab.com/group/project/-/merge_requests/456 → use 456 - Title: "Add new feature (!456)" → use 456 Note: This is NOT the global MR ID
merge_when_pipeline_succeedsNoAuto-merge on pipeline success Type: boolean Default: false Options: - true: Merge automatically when CI passes - false: Manual merge required Requirements: Pipeline must be running Use case: Ensure CI passes before merging
should_remove_source_branchNoDelete source branch after merge Type: boolean Default: false Options: - true: Delete branch after successful merge - false: Keep branch after merge Requirements: User must have permission to delete Use case: Automatic cleanup of feature branches
merge_commit_messageNoCustom merge commit message Type: string Optional: Yes Variables supported: - %{title}: MR title - %{description}: MR description - %{reference}: MR reference (!123) Example: 'Merge %{title} (%{reference})' Default: GitLab's default format
squash_commit_messageNoCustom squash commit message Type: string Optional: Yes Variables supported: Same as merge_commit_message Example: '%{title} (#%{reference})' Use case: Customize squashed commit message
squashNoSquash commits on merge Type: boolean Default: Follows project settings Options: - true: Combine all commits into one - false: Keep all commits - null: Use project default Use case: Clean commit history
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it's a write operation (implied by 'Merge'), returns a result with commit SHA, and lists prerequisites (no conflicts, approvals met, CI passing). It also mentions options like squash and auto-merge. However, it lacks details on error handling, rate limits, or authentication needs, which are important for a mutation tool.

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?

The description is well-structured and front-loaded with the core action and return value, followed by usage guidelines, prerequisites, and related tools. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to scan.

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

Completeness4/5

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

Given the complexity of a merge operation with 7 parameters and no output schema, the description is mostly complete. It covers purpose, usage, prerequisites, and related tools, but lacks details on output format (beyond 'Merge result with commit SHA') and error scenarios. With no annotations, it compensates well but could be more thorough for a mutation tool.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds minimal parameter semantics by mentioning 'Options: Squash, delete branch, auto-merge', which loosely maps to parameters like 'squash', 'should_remove_source_branch', and 'merge_when_pipeline_succeeds', but doesn't provide additional meaning beyond the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 specific action ('Merge an approved merge request') and resource ('merge request'), distinguishing it from siblings like gitlab_approve_merge_request (adds approval) and gitlab_rebase_merge_request (fixes conflicts). It explicitly mentions the return value ('Returns: Merge result with commit SHA'), making the purpose unambiguous.

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 provides explicit guidance with 'Use when: MR is approved and ready', 'Prerequisites:' listing conditions (no conflicts, approvals met, CI passing), and 'Related tools:' naming alternatives for checking status, adding approval, and fixing conflicts. This clearly defines when to use this tool versus others.

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/Vijay-Duke/mcp-gitlab'

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