Skip to main content
Glama

list_merge_request_diffs

Read-only

List merge request diffs with pagination to review code changes, using a project ID plus merge request IID or source branch.

Instructions

List merge request diffs with pagination (merge_request_iid or source_branch required). For one known resource, use the matching get 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": "list_merge_request_diffs"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
summaryNoIf true, return only high-signal fields (id, iid, title, state, web_url, …). Default false keeps the full GitLab JSON.
unidiffNoPresent diffs in the unified diff format. Default is false. Introduced in GitLab 16.5.
jmespathNoOptional JMESPath expression filtering the JSON result before return.
per_pageNoNumber of items per page (max: 100, default: 20)
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.3.8
    • addedInput schema / properties / summary
      Added value: +{
      +  "description": "If true, return only high-signal fields (id, iid, title, state, web_url, …). Default false keeps the full GitLab JSON.",
      +  "type": "boolean"
      +}
  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. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "project_id"
      +]
  9. First observedv1.0.0

TDQS

A3.8/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 only needs to add context. It contributes the pagination behavior and the requirement that an IID or source branch be supplied, but says nothing about ordering, diff truncation, size limits, or response shape. Adequate against an already-rich annotation and schema set, but thin on behavior beyond them.

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?

Two short sentences, zero filler, and the invocation-critical constraint sits in the opening line ahead of the alternative-tool routing. Every clause carries information an agent needs.

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 8 parameters, no output schema, and readOnlyHint covering safety, the description covers the essentials: what it lists, that it paginates, and the required selector. The main shortfall is the unspecified "matching get tool," which forces the agent to disambiguate among several diff-related siblings on its own.

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 the baseline is 3, but the description adds a constraint the schema does not encode: it states merge_request_iid or source_branch is required, while the schema lists only project_id as required. That is real meaning beyond the schema and useful for correct invocation. It leaves page/per_page interaction and the summary/unidiff tradeoffs entirely to the schema.

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 pairs a specific verb and resource ("List merge request diffs") with a scope constraint (pagination; merge_request_iid or source_branch required), which lets an agent distinguish this list operation from the get_merge_request_diffs sibling. It stops short of naming the sibling explicitly, so differentiation is implied by the singular/plural distinction rather than stated.

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?

"For one known resource, use the matching get tool" gives a genuine when-to-use rule: list when the target is not pinned down, get when it is. The gap is that "the matching get tool" is not named, and with siblings like get_merge_request_diffs, get_merge_request_file_diff, and list_merge_request_changed_files available, the agent must infer which one is meant.

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