Skip to main content
Glama

Git Diff

git_diff

Show staged and unstaged changes in a Git repository to inspect modifications before committing. Optionally limit output to staged changes and specify the repository path.

Instructions

Show staged and unstaged changes (git diff).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "git_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
stagedNoIf True, show only staged changes (git diff --cached).
repo_pathNoPath to the git repository..

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden, and it conveys only that this is a read-style operation via "Show". It says nothing about error behavior outside a repo, handling of large diffs or binary files, or whether untracked files are included — all relevant for a diff tool.

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?

One short sentence with the core noun phrase front-loaded and zero filler. Nothing is redundant or buried.

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?

An output schema exists, so return values need no explanation, and both parameters are documented in the schema. However, the blanket phrase "staged and unstaged changes" is slightly at odds with the default staged=false behavior (unstaged only), leaving an ambiguity an agent could trip over.

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 both parameters (staged, repo_path) are already fully documented, including the --cached mapping. The description merely alludes to "staged and unstaged" and adds no format or scoping detail beyond the schema, so baseline 3 applies.

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 names a specific verb ("Show") and resource (staged and unstaged changes) and even maps itself to the underlying command (git diff). It does not explicitly differentiate itself from siblings like git_status or git_log, which is the only thing keeping it from 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 Guidelines2/5

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

There is no guidance on when to pick this over git_status (file-level summary) or git_log (commit history), and no stated preconditions such as being inside a valid git repository. The only usage signal is implicit in the word "changes".

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