Skip to main content
Glama

Show config git diff

git_diff
Read-onlyIdempotent

Display unstaged tracked-file changes or a commit's stat summary to review edits before committing or inspect a past commit's scope.

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_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.

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
shaNoCommit SHA or ref to show a stat summary for, e.g. 'a1b2c3d'. Omit to show the unstaged diff instead.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/non-destructive annotations by disclosing the concrete implementation paths, the return type (raw str), two distinct error conditions (RuntimeError from _repo() when no git repo exists, gitpython exception on an unresolvable sha), and a size/format limit for large diffs. This is exactly the operational context annotations cannot carry.

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-loaded with the one-line purpose, then organized into labeled Use/Returns/Errors/Limits blocks. Every sentence carries distinct information; no restatement of the title or schema fields for their own sake.

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 single-optional-parameter read tool, the definition covers behavior, selection criteria, return format, failure modes, and output-size caveats. Although an output schema exists, the description's note that output is raw unformatted text adds useful framing about what the schema cannot express.

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% and the schema already explains sha with an example and the omit-behavior, so the baseline is 3. The description adds genuine meaning by mapping the presence/absence of sha to two different git commands and output shapes (stat summary vs unified diff), which the schema 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?

Opens with a specific verb and resource plus both operating modes: 'Show unstaged changes, or one commit's stat summary.' It then names the exact underlying calls (repo.git.diff() vs git show --stat <sha>) and explicitly scopes out staged and untracked changes, so an agent can distinguish it from siblings like git_status without reading the schema.

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

Usage Guidelines5/5

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

Provides an explicit 'Use when' clause covering both modes (reviewing before committing, summarising a past commit) and states what the tool does NOT cover, pointing to git_status for untracked files. The sha/no-sha branch is framed as the selector between the two behaviors, leaving little to inference.

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