Skip to main content
Glama

Show config git diff

git_git_diff
Read-onlyIdempotent

Show unstaged changes or a commit's per-file change stats. Use before committing to review, or to summarize a past commit.

Instructions

Show unstaged changes, or one commit's stat summary.

Without sha, calls repo.git.diff() for the unified diff of unstaged changes to tracked files in /config, excluding staged changes and untracked new files (see git_git_status). With sha, calls git show --stat <sha> for the commit header and per-file changed-line counts, not the actual patch.

Use when: reviewing what changed before committing, or summarising one past commit. Returns: str, the raw diff or stat text. Errors: raises RuntimeError (from _repo()) when no git repo exists; raises an exception from gitpython when sha does not resolve to a commit. Limits: output is raw, unformatted text and can be large for big diffs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shaNoCommit SHA or ref to show a stat summary for, e.g. 'a1b2c3d'. Omit to show the unstaged diff instead.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / sha / description
      Added value: +"Commit SHA or ref to show a stat summary for, e.g. 'a1b2c3d'. Omit to show the unstaged diff instead."
  2. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description goes well beyond them: it names the exact git operations invoked, states that staged/untracked changes are excluded, documents the two error paths (RuntimeError from _repo() with no repo, gitpython exception on an unresolvable sha), and warns output is raw and potentially large.

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?

Front-loads the two modes, then organizes the rest as labeled Use when / Returns / Errors / Limits blocks. It is somewhat long but every section carries non-redundant information, so nothing reads as filler.

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 diff tool it is complete: mode selection, output nature, failure conditions, and size limits are all present. An output schema exists, so explaining return values was optional, yet the description still frames what text comes back usefully.

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% (sha is documented with an example), so the baseline is 3. The description adds genuine meaning on top by explaining the sha/no-sha branch in behavioral terms ('With sha... the commit header and per-file changed-line counts, not the actual patch'), which the schema field alone does not convey.

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?

States a specific verb and resource ('Show unstaged changes, or one commit's stat summary') and cleanly splits the two behavioral modes on the presence of `sha`. It also distinguishes itself from the sibling `git_git_status`, so an agent can pick correctly without opening a schema.

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?

'Use when: reviewing what changed before committing, or summarising one past commit' gives clear situational context, and the untracked-files caveat routes the reader to `git_git_status`. It does not explicitly contrast against the overlapping `git_git_log` commit-history sibling, so it stops short of full when-not guidance.

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

Deploy Server

Other Tools