Skip to main content
Glama

get_commit_diff

Read-only

Fetch the diff of a specific commit in a GitLab project using the project ID and commit SHA or branch/tag name. Returns the changes as JSON.

Instructions

Get changes/diffs of a specific commit. Read-only; missing resources, denied access, and rate limits return errors. project_id/group_id take a numeric ID or URL-encoded path.

Input Schema

TableJSON 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.8/5.0
Behavior4/5

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

With readOnlyHint/openWorldHint annotations already covering the safety profile, the description still adds value by disclosing error behavior for missing resources, denied access, and rate limits, plus ID/path format conventions. It stops short of describing return shape or whether diff is paginated beyond the schema hint.

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?

Three tight sentences with zero filler, front-loading the core purpose before behavioral and parameter notes. Every clause earns its place.

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 full schema coverage and no output schema, the description covers purpose, error semantics, and ID conventions adequately. Minor gap: no note on diff size/pagination behavior despite the full_diff parameter implying the diff can be large.

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%, so all four params (sha, jmespath, full_diff, project_id) are already documented in the schema. The description only adds the project_id/group_id numeric-or-URL-encoded-path convention, which is a marginal addition over the schema's own wording.

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?

Clear verb+resource ('Get changes/diffs of a specific commit'), and it is distinguishable from siblings like get_commit (metadata) and get_merge_request_diffs (MR scope). It does not explicitly name or contrast with those siblings, keeping it 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?

Usage context is only implied by the purpose statement. No explicit when-to-use vs get_commit or get_merge_request_diffs guidance, and no exclusions are stated, so it sits at the minimum-viable level.

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