Skip to main content
Glama

gitlab_merge_mr

DestructiveIdempotent

Merges a GitLab merge request by IID after verifying merge_status, handling conflicts or pipeline issues.

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 value beyond annotations by specifying that the tool writes to the target branch (destructive), checks merge_status, and returns a cannot_merge status on failure. It aligns with destructiveHint=true and readOnlyHint=false.

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 concise at four sentences, front-loading the core purpose. Every sentence contributes essential information (purpose, side effects, preconditions, example, usage guidance) without redundancy.

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 moderate complexity (2 parameters, output schema exists), the description covers purpose, behavior, parameter usage, and a key precondition. It is complete enough for an agent to invoke correctly.

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

Parameters4/5

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

Schema coverage is 100%, providing full parameter descriptions. The description enhances understanding with an example mapping 'Merge !42' to mr_iid=42, and clarifies the project_path default behavior.

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 performs the actual merge of a GitLab MR, using specific verb 'merge' and resource 'MR'. It distinguishes from sibling tools like gitlab_create_merge_request by specifying 'actual merge' and including pre-conditions.

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

Usage Guidelines4/5

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

The description advises checking gitlab_get_merge_request first when conflicts are suspected, and explains that the tool checks merge_status before proceeding. It could be more explicit about exact conditions to avoid calling, but the guidance is clear and actionable.

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