Skip to main content
Glama

get_merge_request_file_diff

Read-only

Fetch diffs for specific files in a merge request using project ID, file paths, and either merge request IID or source branch.

Instructions

Get diffs for specific files from a merge request (merge_request_iid or source_branch required).

Input Schema

NameRequiredDescriptionDefault
unidiffNoPresent diff in the unified diff format. Default is false.
jmespathNoOptional JMESPath expression filtering the JSON result before return.
file_pathsYesList of file paths to retrieve diffs for (e.g. ['src/api/users.ts', 'src/repo/user.go']). Call list_merge_request_changed_files first to get the full list of changed paths.
project_idYesProject ID or URL-encoded path
source_branchNoSource branch name
merge_request_iidNoMerge request IID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.3.22
    • changedInput schema / properties / merge_request_iid / description
      Previous value: -"The IID of a merge request"New value: +"Merge request IID"
    • changedInput schema / properties / project_id / description
      Previous value: -"Project ID or complete URL-encoded path to project"New value: +"Project ID or URL-encoded path"
  2. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  3. Addedv2.1.18
  4. Removedv2.1.14
  5. Addedv2.1.11
  6. Removedv2.1.10
  7. Addedv2.1.9

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered and the description need not repeat it. The description adds the either/or MR identifier constraint, but says nothing about diff size limits, truncation, or response shape — relevant gaps for a diff-returning tool with no output schema.

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?

A single sentence that front-loads the action and resource and ends with the key constraint. Nothing is redundant and nothing needs reordering.

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

Completeness3/5

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

For a six-parameter, read-only retrieval tool with no output schema, the description covers what it returns at a high level and the identifier constraint. It leaves out practical behavior an agent would want — whether all requested paths are returned in one call, how large diffs are handled, and how this differs from the sibling diff tools.

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%, so baseline would be 3, but the description contributes a genuine cross-parameter constraint: merge_request_iid OR source_branch, neither of which appears in the schema's required list. That is meaning the schema does not enforce on its own.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Get diffs') plus a narrowing scope ('for specific files from a merge request'), which separates it from the broader list_merge_request_diffs and get_merge_request_diffs siblings. It stops short of naming those alternatives, so the differentiation is inferable rather than explicit.

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 parenthetical '(merge_request_iid or source_branch required)' gives a precondition for calling, which is useful. However, it never says when to prefer this over get_merge_request_diffs or list_merge_request_diffs, nor that the file_paths prerequisite (list_merge_request_changed_files) lives only in the schema, so routing guidance is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.