Skip to main content
Glama

list_merge_request_diffs

Read-only

Retrieve merge request diffs with pagination by project ID and either merge request IID or source branch. Use unified diff format or JMESPath to filter and inspect changes.

Instructions

List merge request diffs with pagination (mergeRequestIid or branchName required). Use this for a collection of resources; choose the corresponding get tool when you already know the single resource to inspect. It is read-only and does not mutate GitLab data; missing resources, invalid identifiers, insufficient permission, and rate limits are returned as errors. When project_id or group_id is accepted, provide the numeric ID or complete URL-encoded path described by the schema; use required identifiers and pagination fields exactly as documented.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
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 complete URL-encoded path to project
source_branchNoSource branch name
merge_request_iidNoThe IID of a merge request

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.66
    • addedInput schema / properties / jmespath
      Added value: +{
      +  "description": "Optional JMESPath expression filtering the JSON result before return.",
      +  "type": "string"
      +}
  2. Addedv2.1.18
  3. Removedv2.1.14
  4. Addedv2.1.11
  5. Removedv2.1.10
  6. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "project_id"
      +]
  7. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, but the description adds value by explicitly stating it does not mutate GitLab data and by enumerating error conditions such as missing resources, invalid identifiers, insufficient permission, and rate limits. This is useful context beyond the annotations, though not exhaustive.

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

Conciseness3/5

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

The description is reasonably front-loaded with the action and pagination, and the read-only/error sentence adds useful context. However, the final sentence repeats schema guidance, references group_id outside the schema, and the parenthetical identifier requirement is unclear, adding noise.

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?

It covers purpose, pagination, read-only behavior, error handling, and the collection-vs-single guidance. But with no output schema, it does not describe what a returned diff list looks like, and it muddies identifier requirements; for a 7-parameter tool this is only partially complete.

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 coverage is 100%, so the baseline is 3, but the description adds unreliable semantics: 'mergeRequestIid or branchName required' conflicts with the schema's only required parameter being project_id, 'branchName' is not a schema parameter, and group_id is mentioned though absent from the schema. The URL-encoded path advice mostly duplicates the schema, so the net contribution is negative and potentially misleading.

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 action ('List merge request diffs with pagination') and identifies the tool as the collection-oriented alternative to a get tool. However, the parenthetical claiming 'mergeRequestIid or branchName required' uses names that do not match the schema and could confuse an agent, so it does not earn 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 Guidelines4/5

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

It explicitly says to use this for a collection of resources and to choose the corresponding get tool when inspecting a single resource. It does not name the exact sibling tool or cover alternatives like changed-files tools, but it gives clear enough when-to-use direction.

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