Skip to main content
Glama

get_diff

Compare a file between two commits. Get the unified diff to see exactly what changed.

Instructions

Return the unified diff of one file between two commit hashes (typically obtained from get_history for the same file). Read-only; no side effects, auth, or rate limits. Order matters — commit_a is treated as the earlier side; reversing the args inverts the diff. Throws if either hash is unknown to the file's repo. Use after get_history to see WHAT changed, not just THAT it changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesID of the file
commit_aYesEarlier commit hash (from get_history)
commit_bYesLater commit hash (from get_history)
Behavior4/5

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

No annotations provided, so description carries full burden. Declares 'Read-only; no side effects, auth, or rate limits' and warns of throws for unknown hashes. Does not detail error handling or return format, but covers key behavioral traits.

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?

Three efficient sentences with no waste. Main action front-loaded, each sentence adds unique value (purpose, transparency, guidelines). Perfectly concise.

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?

Fairly complete for a diff tool. No output schema, but description specifies return is 'unified diff'. Could be improved by detailing return format (e.g., string of lines). However, context signals (no output schema, low complexity) make current level acceptable.

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% with descriptions for all 3 parameters. Description adds value by clarifying commit_a as 'earlier side' and linking hashes to get_history. This enhances meaning beyond schema, justifying above baseline 3.

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?

Description states 'Return the unified diff of one file between two commit hashes', clearly specifying verb, resource, and scope. It distinguishes from sibling 'get_history' by noting the purpose is to see what changed, not just that it changed.

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?

Explicitly advises 'Use after get_history to see WHAT changed, not just THAT it changed.' Also notes ordering matters and that reversing args inverts the diff. Missing explicit when-not or alternative tools, but provides clear usage context.

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/safiyu/ctxnest'

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