Skip to main content
Glama

git_diff

Compare a repository's working tree against HEAD or a base revision and return diff stats or patch pages, with protected files shown as notices.

Instructions

Read working tree versus HEAD or base...HEAD diff, with protected files replaced by notices. No approval window; client Host in both modes. Fixed Git never runs repository hooks/filters or configured programs. Maximum 3 processes, 15 seconds each; content pages <=64 KiB with next_offset. Sanitized errors; never auto-retry.

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": {
      "path": "<path>"
    },
    "name": "git_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoOptional revision: 1..200 ASCII letters/digits or ._/@^~-; no leading -, .. or colon; compares base...HEAD.
pathYesAbsolute repository directory within configured read roots, including read: folders; top must also be allowed.
pathsNoOptional maximum 32 literal relative paths inside repository and read roots; no traversal, options, colon, NUL or newline.
offsetNoByte cursor 0..268435456 from next_offset; 64 KiB pages. Repository changes between calls can change pages.
stat_onlyNoReturn only the diff stat instead of a patch; default false compares working tree against HEAD.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.5

TDQS

A3.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly. It discloses protected-file replacement, absence of an approval window, that Git will not run repository hooks, filters, or configured programs, process/time limits, pagination limits, sanitized errors, and no auto-retry.

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?

The description is compact and front-loads the core purpose before covering safety, limits, and pagination behavior. Some phrasing is dense and jargon-like, such as 'No approval window; client Host in both modes' and 'Fixed Git,' which slightly reduces clarity.

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?

The tool has five parameters, full schema coverage, and an output schema, so the description does not need to explain return shape. It covers the important behavioral constraints, but a few phrases remain opaque and could leave an agent unsure about meaning rather than missing critical invocation details.

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 five parameters are already documented in the input schema. The description adds only indirect context about pagination via next_offset and does not materially extend parameter meaning beyond 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 states a specific verb and resource: read a working-tree versus HEAD diff, or a base...HEAD diff. It also adds the important scoping detail that protected files are replaced by notices. It does not explicitly differentiate itself from sibling tools such as git_show or git_log, so it falls 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?

The description implies when to use the tool by naming the two diff modes, working tree versus HEAD and base...HEAD. However, it gives no explicit guidance on when to prefer git_diff over alternatives such as git_show or git_log, and it does not state when not to use it.

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