Skip to main content
Glama

Diff

diff
Read-only

Compare two text files and display a unified change summary with context lines to identify differences between file versions.

Instructions

Compare two text files and return a unified diff from a to b, like diff -u.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst file to compare
bYesSecond file to compare
contextNoNumber of context lines surrounding each change (default: 3)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv2.0.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already establish read-only behavior, so the description need not repeat that. It adds the important ordering behavior (from a to b) and the output format ('unified diff, like diff -u'), which are not in annotations or schema. It does not discuss edge cases such as identical files or how the context parameter is applied, so the disclosure is adequate but not rich.

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?

A single front-loaded sentence that states action, input, and output with no filler. Every phrase ('Compare', 'two text files', 'unified diff', 'from a to b', 'like diff -u') carries semantic weight.

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?

For a read-only comparison tool with a self-describing schema, the description covers the key agent-facing facts: inputs, direction, and output format. It leaves edge-case behavior to implementation, but no output schema exists and the phrase 'like diff -u' provides a known format. This is sufficient for correct invocation.

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?

The schema descriptions already cover all three parameters at 100%, so the default baseline is 3. The description adds meaning by clarifying that a is the source/original and b is the target ('from a to b'), which removes ambiguity in how arguments should be passed. It does not comment on the context parameter, but the schema already defines its default, minimum, and maximum.

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?

The description uses a specific verb ('Compare') and names the resource ('two text files') plus the exact output form ('unified diff'), so the tool's core purpose is unmistakable. It does not explicitly name a sibling alternative, but 'compare' is distinct from the create/edit/delete/search siblings.

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?

The description implies its use case: whenever two text files need to be diffed, rather than edited or searched. It gives no explicit 'when not to use' guidance or sibling routing, so an agent must infer the context from tool name and purpose.

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