Skip to main content
Glama

git_diff

View unified diffs for unstaged, staged, head, or any branch/commit changes. Preview per-file change counts with stat_only before examining the full diff.

Instructions

Show changes as a unified diff. against="worktree" (default, unstaged changes), "staged", "head" (staged + unstaged), or a branch/commit name to compare the current branch against it (uses the merge base). Use stat_only=true first on a large change to see which files moved before pulling in the full diff.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNoLimit the diff to these paths.
againstNo"worktree" | "staged" | "head" | branch or commit ref. Default "head".
stat_onlyNoOnly per-file change counts. Default false.
workspaceNoWorkspace alias. Defaults to the active workspace.
context_linesNoContext lines around each hunk. Default 3.
Behavior2/5

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

With no annotations, the description carries the full burden. It discloses merge base behavior and stat_only usage, but directly contradicts the schema by claiming 'worktree' is the default while the schema specifies default 'head'. This misleads the agent about the command's default behavior and undermines trust.

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 two sentences, front-loaded with the main purpose, and the stat_only tip is valuable. The first sentence is dense and contains an awkward parenthetical, making it slightly less crisp, but overall it is efficient and well-structured.

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?

The tool has 5 parameters, no output schema, and no annotations. The description covers the central against options and a recommended workflow, but omits guidance on paths, context_lines, and workspace usage beyond the schema. The default-value error is a notable gap, making the description adequate but incomplete.

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 coverage is 100%, so baseline is 3, but the description adds value by explaining against semantics and stat_only usage. However, it contains a false claim about the default value for against, which actively misleads parameter selection and lowers the score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Show changes as a unified diff' with a clear verb and resource, and the detailed against options help distinguish it from siblings like git_status and git_log. The core purpose is unambiguous and well-scoped.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The description explains when to use different against values (worktree, staged, head, branch) and explicitly recommends stat_only=true for large changes. It lacks explicit exclusions or named alternatives, but the parameter guidance gives solid context for selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zcrossoverz/repo-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server