Skip to main content
Glama

get_merge_request_diffs

Read-only

Retrieve a merge request's changes and diffs by IID or source branch, with optional file exclusion patterns and inline or parallel view.

Instructions

Get the changes/diffs of a merge request (merge_request_iid or source_branch required). To find resources, use the matching list or search tool.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>"
    },
    "name": "get_merge_request_diffs"
  }
}

Input Schema

NameRequiredDescriptionDefault
viewNoDiff view type
jmespathNoOptional JMESPath expression filtering the JSON result before return.
project_idYesProject ID or URL-encoded path
source_branchNoSource branch name
merge_request_iidNoMerge request IID
excluded_file_patternsNoArray of regex patterns to exclude files from the diff results. Each pattern is an RE2 regular expression that matches file paths to ignore. RE2 runs in linear time but does not support lookahead, lookbehind, or backreferences. At most 50 patterns of at most 200 characters each. Examples: ["^vendor/", "^test/mocks/", "\.spec\.ts$", "package-lock\.json"]

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.3.27
    • changedInput schema / properties / excluded_file_patterns / description
      Previous value: -"Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: [\"^vendor/\", \"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]"New value: +"Array of regex patterns to exclude files from the diff results. Each pattern is an RE2 regular expression that matches file paths to ignore. RE2 runs in linear time but does not support lookahead, lookbehind, or backreferences. At most 50 patterns of at most 200 characters each. Examples: [\"^vendor/\", \"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]"
    • addedInput schema / properties / excluded_file_patterns / items / maxLength
      Added value: +200
    • addedInput schema / properties / excluded_file_patterns / maxItems
      Added value: +50
  2. 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"
  3. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  4. Addedv2.1.18
  5. Removedv2.1.14
  6. Addedv2.1.11
  7. Removedv2.1.10
  8. Changed3 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / excluded_file_patterns
      Added value: +{
      +  "description": "Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: [\"^vendor/\", \"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / required
      Added value: +[
      +  "project_id"
      +]
  9. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered, but the description adds nothing beyond that. It says nothing about diff output size, truncation of large diffs, pagination, or how excluded_file_patterns changes results — all material behaviors for a diff-fetching tool. With annotations doing the safety work, this is a weak contribution rather than a contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with the core operation front-loaded and the identifier constraint immediately after it. The second sentence is thin boilerplate pointing vaguely at 'the matching list or search tool' rather than a named alternative, which is the only wasted space.

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?

With six parameters, an enum, and a rich regex parameter but no output schema, the definition is minimally adequate: an agent knows what it fetches and how to identify the merge request. It is silent on return shape, diff size limits, and how to page or narrow output, which matters for a tool whose payload is typically large. Acceptable but with clear gaps.

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 is 3, and the description earns an upgrade by declaring that merge_request_iid or source_branch is required — a constraint the schema does not encode, since only project_id is listed as required. That resolves a real ambiguity about how to identify the merge request. It adds no meaning for view, jmespath, or excluded_file_patterns beyond their already-rich schema descriptions.

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?

States a specific verb+resource: 'Get the changes/diffs of a merge request'. It clearly identifies the resource and the operation, and the parenthetical identifier constraint narrows the scope. It does not explicitly distinguish itself from sibling list_merge_request_diffs or get_merge_request_file_diff, so it falls short of a 5.

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?

Only guidance given is 'To find resources, use the matching list or search tool', which is generic boilerplate and names no actual sibling. There is no when-to-use vs when-not, and no note on when to prefer get_merge_request_file_diff or list_merge_request_diffs over this tool. Usage is only implied by the merge-request diffs naming.

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