Skip to main content
Glama

Get Merge Request File Diff

gitlab_get_merge_request_file_diff
Read-onlyIdempotent

Fetch diffs for specific files from a GitLab merge request, enabling focused review of large MRs without loading full changes.

Instructions

Step 2 for large MR review: fetch diffs for specific files from a merge request.

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": {
      "file_paths": "<file_paths>"
    },
    "name": "gitlab_get_merge_request_file_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
unidiffNo
file_pathsYes
project_idNo
source_branchNo
merge_request_iidNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.7.0
    • removedInput schema / properties / merge_request_iid / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / merge_request_iid / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / unidiff / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / unidiff / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
  2. First observedv1.6.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=true, destructiveHint=false, so the safety profile is covered. The description adds the useful context that this is a scoped fallback for large MRs, but says nothing about truncation limits, diff size caps, or what the returned diff structure looks like.

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?

A single front-loaded sentence with no filler; the workflow role is stated first. It is efficient, though 'Step 2' is opaque without knowledge of the preceding step, and the terseness leaves no room for parameter hints.

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?

No output schema exists, and four of five parameters are undescribed anywhere, including the format-affecting unidiff flag. For a file-scoped diff fetch with branching behavior, the definition is thinner than it should be, even though the core action is clear.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description carries the full explanatory burden and does not meet it. It alludes to file selection and the merge request but never explains unidiff (the boolean that changes output format), source_branch, or how project_id and merge_request_iid are resolved when omitted.

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 concrete verb and resource: fetch diffs for specific files from a merge request, and frames it as the file-scoped step of a review workflow. That is distinguishable from the whole-MR diff siblings, but the description never names those siblings, so the agent must infer the distinction from names alone.

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?

'Step 2 for large MR review' implies when it is appropriate (large MRs, targeted files) but never states when not to use it or which tool to use instead for a full MR diff. The guidance is implied rather than explicit, and it presumes the agent already knows what Step 1 was.

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

Deploy Server

Other Tools