Skip to main content
Glama

read_diff

View only the changed hunks after editing a file, reducing token usage by avoiding full re-reads. Requires a prior baseline snapshot.

Instructions

Use INSTEAD OF re-reading whole file after edits. Shows only changed hunks. REQUIRES: call smart_read or read_for_edit BEFORE editing to create baseline snapshot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
context_linesNoLines of context around changes (default: 3)
Behavior5/5

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

No annotations provided, but the description fully covers behavior: it shows only changed hunks (read-only), requires a baseline snapshot, and implies no side effects. No contradictions.

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 plus a required precondition line. Every sentence serves a purpose: purpose, usage guidance, prerequisite. Front-loaded with the key substitution advice.

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?

For a simple diff viewing tool with no output schema, the description is complete. It explains input (path, context lines), output (changed hunks), and prerequisites. No missing context.

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 has 100% coverage for both parameters ('path' and 'context_lines' with descriptions). The description adds little beyond 'shows only changed hunks', which is already implied. Baseline 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 clearly states the tool's purpose: to show changed hunks instead of re-reading the whole file after edits. It uses specific verb 'show' and resource 'changed hunks', distinguishing it from re-reading the entire file.

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 says 'Use INSTEAD OF re-reading whole file after edits' and provides a requirement ('call smart_read or read_for_edit BEFORE editing to create baseline snapshot'). This gives clear when-to-use and prerequisites, with implied alternatives.

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/Digital-Threads/token-pilot'

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