Skip to main content
Glama

gitlab_merge_mr

DestructiveIdempotent

Merge GitLab merge requests after verifying they are conflict-free and pipeline requirements are met. This tool checks merge status before performing the merge operation to prevent errors.

Instructions

Perform the actual merge if GitLab reports the MR can be merged.

Destructive: writes to the target branch. Checks merge_status first and returns status='cannot_merge' if conflicts exist or pipelines are required.

Examples: - "Merge !42" → mr_iid=42 - Don't call without checking gitlab_get_merge_request first when you suspect conflicts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mr_iidYesMerge request IID to merge.
project_pathNoGitLab project path (e.g. 'my-org/my-repo'). When omitted, the default from GITLAB_PROJECT_PATH env var is used.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
iidNo
titleNo
stateNo
source_branchNo
target_branchNo
merge_statusNo
has_conflictsNo
web_urlNo
statusNo
hintNo
Behavior4/5

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

The description adds valuable behavioral context beyond annotations: it explains the destructive nature ('writes to the target branch'), describes the pre-merge check logic ('Checks merge_status first'), and specifies error conditions ('returns status='cannot_merge' if conflicts exist or pipelines are required'). While annotations already declare destructiveHint=true, the description provides operational details that help the agent understand the tool's behavior.

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 efficiently structured with a clear purpose statement upfront, followed by behavioral notes, and practical examples. Every sentence serves a distinct purpose: the first states the core function, the second explains constraints, and the examples demonstrate usage patterns. No wasted words.

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 that this is a destructive mutation tool with comprehensive annotations (including destructiveHint, idempotentHint) and an output schema exists, the description provides excellent context. It covers the tool's purpose, usage guidelines, behavioral constraints, and includes practical examples. The combination of description and structured data gives the agent everything needed to use this tool correctly.

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?

With 100% schema description coverage, the schema already fully documents both parameters (mr_iid and project_path). The description provides examples ('Merge !42' → mr_iid=42) that illustrate parameter usage but doesn't add significant semantic meaning beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

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 ('Perform the actual merge') on a specific resource ('MR' - merge request) with explicit conditions ('if GitLab reports the MR can be merged'). It distinguishes from siblings like gitlab_get_merge_request (read-only) and gitlab_create_merge_request (creation vs. merging).

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 on when to use ('if GitLab reports the MR can be merged') and when not to use ('Don't call without checking gitlab_get_merge_request first when you suspect conflicts'). It names the specific alternative tool (gitlab_get_merge_request) for prerequisite checking.

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/mshegolev/gitlab-ci-mcp'

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