Skip to main content
Glama

get_diff

Provide two commit hashes from get_history to view the unified diff of a file and understand what changed between them.

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)
Behavior5/5

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

Discloses read-only nature, no side effects, no auth, no rate limits, order sensitivity, and error condition. With no annotations provided, the description carries full burden and covers it well.

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?

Two concise sentences: first states purpose and provenance, second adds transparency and usage. No wasted words.

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?

Description is complete for usage context, but lacks explicit mention of return format (unified diff is implied). Given no output schema, a brief note on output would be ideal. Still highly functional.

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

Parameters5/5

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

Schema covers 100% of parameters, but description adds meaning: commit a/b typically from get_history, order matters (commit_a earlier, reversing inverts diff). This adds value beyond schema.

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 it returns a unified diff of one file between two commit hashes, using specific verbs and resource. It distinguishes itself from sibling tools like get_history (shows that changed vs. what changed) and diff_against_disk.

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?

Explicitly guides when to use ('Use after get_history') and mentions order matters, reversing args inverts diff, and throws on unknown hash. Provides clear context for selection.

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/kontexta'

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