Skip to main content
Glama

Git diff with content

git_diff_content
Read-only

Show git diff as structured patch content with parsed hunks per file, so you can inspect actual code changes instead of raw unified diff text. Scope by refs, path, staged changes, or context lines.

Instructions

Show git diff with structured patch content. Returns parsed hunks per file instead of raw unified diff text. Use this when you need to see actual code changes, not just file-level stats. Use base+ref for two-ref comparison (e.g. base='main', ref='feature'). Use path to scope to one or more files or directories.

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory (git repo)
refNoDiff against this ref (e.g. 'HEAD~1', 'main', a commit hash)
baseNoBase ref for two-ref comparison. When both ref and base are set, runs git diff <base> <ref>
pathNoLimit diff to one or more files or directories (string or array)
stagedNoShow staged changes (--cached)
contextNoNumber of context lines around changes (passed as -U<n>)

Output Schema

NameRequiredDescriptionDefault
filesYes
summaryYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A4.4/5.0
Behavior4/5

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

The readOnlyHint annotation already establishes that this is a safe read operation, and the description adds useful behavioral context by explaining that output is parsed into structured hunks per file instead of raw unified diff text. It does not discuss limits on large diffs or pagination, but with annotations and an output schema present, that omission is minor.

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?

The description is front-loaded with the core purpose and output shape, then moves efficiently through selection guidance and key parameter usage. Each sentence contributes useful information with no filler.

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

Completeness4/5

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

With an output schema, full parameter schema coverage, and readOnlyHint annotations, the description provides enough context to call the tool correctly. It could mention staged/context behavior for completeness, but those are already handled by the schema and are not essential to the description's role.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters are already documented in the schema. The description reinforces the important usage of base+ref and path, but it does not add syntax or semantics beyond what the schema already states, so the baseline of 3 is appropriate.

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 a specific verb and resource ('Show git diff') and immediately distinguishes the tool's output as 'structured patch content' with 'parsed hunks per file' rather than raw unified diff text. It also contrasts the tool with file-level diff/stat approaches, so an agent can identify its role among siblings like git_diff and git_status.

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?

It explicitly says to use this when actual code changes are needed rather than file-level stats, which provides a clear selection rule against sibling diff/status tools. It also explains how to use base+ref for two-ref comparison and path for scoping, leaving little ambiguity about invocation.

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