Skip to main content
Glama

Git diff

git_diff
Read-only

See what changed in the workspace with git diff. Use staged to view the index, stat for a summary, and path to filter a file. Reports '(no changes)' when empty.

Instructions

Read-only git diff of the workspace: runs 'git diff' without a shell (LC_ALL=C, 30 s timeout) and returns the patch text. Use staged=true for the index (--cached), stat=true for a diffstat (--stat), and path to limit the diff to one workspace-relative file (passed after '--'). Reports '(no changes)' when the diff is empty. Output longer than 64 KiB keeps the first 32 KiB and the last 32 KiB. No --shell flag is needed for this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoWorkspace-relative file or directory to limit the diff to. Absolute paths inside the workspace are also accepted.
statNoReturn a diffstat (git diff --stat) instead of the full patch. Defaults to false.
stagedNoDiff the staged changes (git diff --cached) instead of the working tree. Defaults to false.
workspaceNoWorkspace name (see workspace_list). Defaults to the primary workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

A4.2/5.0
Behavior5/5

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

Discloses execution details (LC_ALL=C, 30 s timeout, no shell), return shape (patch text, '(no changes)' on empty), and truncation behavior at 64 KiB. These add real behavioral context beyond the readOnlyHint/openWorldHint annotations; no contradiction.

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?

Four sentences with no filler; the core purpose is front-loaded, and implementation details and edge cases are compactly packed. Every sentence carries operational information.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with full schema parameter documentation, the description is complete: it covers command execution, output format, empty-diff behavior, output size handling, and the workspace parameter. Since no output schema exists, the explicit return explanation is valuable.

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 coverage is 100%, so the baseline is met and schema descriptions already document each parameter. The description adds flag-level mapping (staged=true for --cached, stat=true for --stat, path passed after '--'), which helps agents use parameters correctly.

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 'Read-only git diff of the workspace' — a specific verb, resource, and scope, and clarifies it runs without a shell, distinguishing it from mutating or shell-based siblings. It could go further by explicitly naming alternatives like git_status or patch, so it stops short of full sibling differentiation.

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?

Provides clear context for when to use the tool (any need for a git diff of the workspace) and covers the main option flags (staged, stat, path), but it does not explicitly contrast it with sibling tools. The guidance is adequate but largely implied rather than stated as selection criteria.

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