Skip to main content
Glama

diff_text

Compare two text strings and return a unified diff showing additions, deletions, and context lines.

Instructions

Compare two text strings and return a unified diff showing additions (+), deletions (-), and context lines. Useful for review agents, changelog generation, and patch creation. Returns '(no differences)' when inputs are identical. Free — no payment required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesThe "before" text (original).
bYesThe "after" text (modified).
contextNoNumber of unchanged context lines around each change (default 3, max 10).
label_aNoLabel for the "before" file header (default "a").
label_bNoLabel for the "after" file header (default "b").
Behavior4/5

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

With no annotations, the description discloses key behavior: returns '(no differences)' for identical inputs. Also states it's free. However, it doesn't mention authentication or rate limits, though for a simple diff tool these are less critical.

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 concise sentences, front-loaded with the core action. No unnecessary words.

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?

Given the simple nature of the tool, full schema coverage, and no output schema needed, the description adequately covers the return behavior for identical inputs and the general purpose.

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?

Input schema has 100% coverage, so baseline is 3. The description adds value by specifying default (3) and max (10) for the 'context' parameter, which is not in the 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 uses a specific verb ('Compare') and resources ('two text strings'), and clearly identifies the output ('unified diff'). It distinguishes from sibling tools like hash_text or text_stats, none of which perform diffs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides use cases ('review agents, changelog generation, patch creation') but lacks explicit when-not-to-use or alternatives. The note about being free is helpful but not a usage exclusion.

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/icosaedro-git/toolsnap-mcp'

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