Skip to main content
Glama

git_diff

Return repository diff statistics and optional patch text for any ref or range. Limit by file path to quickly see what changed.

Instructions

Return the git diff for a repository (stat + optional patch). Prefer stat_only=True for orientation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoDiff target ref or range. Examples: "HEAD~1" (last commit), "main...HEAD" (branch diff), "abc123"HEAD~1
pathNoRepo-relative file path to limit the diff scope (optional). Leave empty for the full diff.
repoYesRepository name from list_repositories(), e.g. "pypto"
stat_onlyNoWhen True return only file-level statistics (no patch text). Useful for large diffs.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description must carry behavioral disclosure. It hints at potentially large diffs via the stat_only recommendation and describes output, but does not explicitly state that the operation is read-only, mention error conditions, or explain repo requirements—though 'git diff' strongly implies non-mutating behavior.

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 a single, efficient sentence that front-loads the primary function ('Return the git diff for a repository') and includes a valuable usage tip without any 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?

Given the tool's simplicity, full schema coverage, and presence of an output schema, the description is sufficient for core understanding. It lacks explicit alternative tool guidance, but the purpose and a key usage recommendation are clear, making it complete for this complexity level.

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 descriptions cover 100% of parameters, providing a baseline of 3. The description adds meaningful guidance beyond the schema by recommending stat_only=True for orientation, which gives contextual purpose that the schema's 'useful for large diffs' does not fully 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?

The description clearly states the tool returns the git diff for a repository, specifying both stat and optional patch. It distinguishes from siblings like git_log and read_file by naming a specific git operation and its output scope.

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 offers a concrete usage recommendation ('Prefer stat_only=True for orientation'), providing context for when to use this parameter. However, it does not explicitly compare with alternative tools or state exclusions, so it falls short of full alternative guidance.

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/georgebisbas/mcp-hw-native-sys'

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