Skip to main content
Glama

files_get_diff

Return the unified diff of one file between two commit hashes. Use after history lookup to see what changed, not just that it changed.

Instructions

Return the unified diff of one file between two commit hashes (typically obtained from files_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 files_get_history to see WHAT changed, not just THAT it changed.

Input Schema

NameRequiredDescriptionDefault
file_idYesID of the file
commit_aYesEarlier commit hash (from get_history)
commit_bYesLater commit hash (from get_history)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.1.2

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: read-only, no side effects, auth, or rate limits, plus argument-order semantics ("reversing the args inverts the diff") and an error condition ("Throws if either hash is unknown"). This is exactly the behavioral context an agent needs.

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 return value, then behavior, then ordering, then error, then usage. Every sentence earns its place with no padding.

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?

No output schema or annotations exist, yet the description fully covers what is returned (unified diff), safety profile, argument ordering, failure mode, and relationship to files_get_history. Nothing an agent needs to call it correctly is missing.

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% (baseline 3), and the description adds real meaning: commit_a is treated as the earlier side and reversing args inverts the diff. This explains ordering semantics that the schema's field descriptions only partially imply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ("Return the unified diff") and resource scope ("of one file between two commit hashes"). It clearly defines the range being diffed. It does not explicitly disambiguate from the sibling files_diff_against_disk, though the commit-hash scope implies the distinction.

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?

Explicit when-to-use guidance: "Use after `files_get_history` to see WHAT changed, not just THAT it changed," and notes the hashes are typically obtained from that tool. It gives clear context but names no alternatives/exclusions to route away from.

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