Skip to main content
Glama

Get merge request diff

gitlab_get_merge_request_diff
Read-only

Retrieve the code changes of a merge request file by file, with optional path filtering and a character limit to keep output readable.

Instructions

The actual code changes of a merge request, file by file. Truncated to stay readable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNoOnly include diffs for these file paths
max_charsNoTruncate the diff to this many characters (default 60000)
project_idNoProject id or URL-encoded path, e.g. `42` or `group/subgroup/project`. Falls back to GITLAB_PROJECT_ID.
merge_request_iidYes
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the describe is not expected to repeat that. The description adds useful context by noting the diff is 'truncated to stay readable' and 'file by file', disclosing that output has size limits and a per-file structure.

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 a single, front-loaded sentence that immediately conveys the tool's purpose and key behavioral limit with no filler or repetition.

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?

Without an output schema, the description sufficiently conveys the return type (code changes, file-by-file) and the truncation behavior. However, it does not specify the exact diff format or behavior when paths filter yields no results, which would be expected for a fully complete specification.

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 descriptions cover 3 of 4 parameters, including the default for max_chars and the meaning of paths and project_id. The description does not add parameter-level detail beyond schema, and merge_request_iid is self-explanatory despite lacking a schema description. The schema carries most semantic weight.

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 returns 'the actual code changes of a merge request, file by file', which precisely identifies the diff resource and distinguishes it from merge request metadata tools like gitlab_get_merge_request. The verb and scope are specific and unambiguous.

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

Usage Guidelines3/5

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

The usage context is only implied: if you need code changes of an MR, this is the tool. There is no explicit statement about when to use it versus alternatives like gitlab_compare or gitlab_get_file, nor any mention of exclusions or prerequisites.

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

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