Skip to main content
Glama

Show git diff

git.diff
Read-only

Show read-only Git diffs for staged or unstaged changes, with optional path filtering, without modifying repository state.

Instructions

Read-only git diff. Never modifies repository state.

Args: path: Optional repository-relative path to filter the diff. staged: Show staged changes (git diff --cached) instead of unstaged ones.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
stagedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rawYes
pathYes
binaryNo
stagedYes
additionsNo
deletionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so 'Read-only... Never modifies repository state' largely restates structured data. It does add the meaningful behavioral detail that `staged` switches the comparison baseline to --cached rather than merely toggling a flag, but no other behavior (scope of paths, empty-diff behavior) is disclosed.

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?

Front-loads the safety statement and then lists args compactly; no filler sentences. The second sentence slightly duplicates the first, keeping it short of a 5.

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?

With only two optional parameters, an output schema present, and annotations covering the safety profile, the description supplies everything needed to invoke it correctly. A brief note on what the diff is taken against by default would make it fully complete.

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 description coverage is 0%, so the description carries the full parameter burden and does so adequately: `path` is described as an optional repository-relative filter and `staged` is explained as selecting --cached instead of unstaged changes. Only minor detail (e.g. path behavior for untracked files) is missing.

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?

States a specific verb and resource ('git diff') and immediately scopes it as read-only. It does not name or differentiate itself from the closest sibling (git.status), but the purpose itself is unambiguous.

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 is only implied: an agent can infer this is for inspecting working-tree changes, but the description never says when to prefer it over git.status or how to interpret 'unstaged' vs 'staged' in a workflow. No exclusions or alternatives are given.

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