Skip to main content
Glama
zix-chen
by zix-chen

Git diff

git_diff
Read-onlyIdempotent

Return unified git diff for workspace changes, including untracked files as additions, so you can verify edits and newly created files before committing.

Instructions

Return unified git diff for workspace changes. Untracked files are included as additions by default, so a newly created file is verifiable here.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
pathsNo
stagedNo
unstagedNo
max_bytesNo
context_linesNo
include_untrackedNoDiff untracked files against an empty file so newly created files appear as additions. Applies to the unstaged pass only.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
diffNo
errorNo
filesNo
warningsNo
truncatedNo
include_untrackedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds the genuinely useful behavior that untracked files are rendered as additions. However, it omits other behavioral traits such as max_bytes truncation, how staged and unstaged passes combine by default, and whether output can be truncated.

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?

Two sentences, front-loaded with the verb and resource, with no filler. The trailing rationale about newly created files is mildly redundant with the schema description but still earns its place as usage framing.

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

Completeness2/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 not be explained, but for a 7-parameter tool with 14% schema coverage the description is too thin. It leaves the agent without guidance on path vs paths, staged/unstaged interaction, or truncation behavior.

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

Parameters2/5

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

Schema description coverage is only 14%, with 7 parameters and only include_untracked documented, so the description is expected to compensate but largely does not. It never clarifies the path vs paths distinction, the staged/unstaged defaults, max_bytes truncation limits, or context_lines. It only restates the untracked behavior already covered by 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?

States a specific verb and resource ('Return unified git diff for workspace changes'), which is unambiguous and distinct from siblings like git_status, git_log, and git_show. It stops short of explicitly contrasting itself with those siblings, so it is clear but not fully self-differentiating.

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 note that untracked files appear as additions and that a newly created file 'is verifiable here' implies a use case, but there is no explicit guidance on when to choose git_diff over git_status, git_show, or reading a file directly. Usage is inferable rather than stated.

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