Skip to main content
Glama

get_commit_diff

Read-only

Fetch file diffs for a specific GitLab commit to inspect exact code changes, and choose commit metadata when patch details are not needed.

Instructions

Get changes/diffs of a specific commit. Return the file diffs for one commit. Use get_commit for metadata without the patch.

Input Schema

NameRequiredDescriptionDefault
shaYesThe commit hash or name of a repository branch or tag
jmespathNoOptional JMESPath expression filtering the JSON result before return.
full_diffNoWhether to return the full diff or only first page (default: false)
project_idYesProject ID or complete URL-encoded path to project

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. Changed1 schema field changedv2.1.62
    • changedInput schema / required
      Previous value: -[
      -  "sha",
      -  "project_id"
      -]New value: +[
      +  "project_id",
      +  "sha"
      +]
  3. Addedv2.1.45
  4. Removedv2.1.43
  5. Addedv2.1.18
  6. Removedv2.1.14
  7. Addedv2.1.11
  8. Removedv2.1.10
  9. Changed2 schema fields changedv2.1.9
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / required
      Previous value: -[
      -  "sha"
      -]New value: +[
      +  "sha",
      +  "project_id"
      +]
  10. First observedv1.0.0

TDQS

A3.9/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. The description adds that the payload is a patch rather than metadata, but says nothing about diff size, truncation, or that paging is controlled by full_diff — behavior an agent would want to know before fetching a large commit.

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?

Three short sentences with the core purpose front-loaded and the routing hint last. Slight redundancy between 'Get changes/diffs' and 'Return the file diffs' keeps it from being maximally tight.

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

Completeness4/5

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

For a read-only retrieval tool with a fully documented schema and no output schema, this covers purpose, scope, and sibling disambiguation. The only real gap is what a returned diff looks like and whether large diffs are truncated, which is left implicit.

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

Parameters3/5

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

Schema description coverage is 100%, with all four parameters documented including the full_diff paging flag and jmespath. The description adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Get changes/diffs of a specific commit') and reinforces it with 'Return the file diffs for one commit.' It explicitly separates itself from the sibling get_commit, so an agent can choose between them without reading schemas.

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?

Names the alternative (get_commit) and the condition that selects it ('metadata without the patch'), which is the exact routing decision an agent faces. It stops short of covering other near-neighbors like get_merge_request_diffs or list_commit_changed_files, so it is clear but not exhaustive.

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