Skip to main content
Glama

Diff

diff
Read-only

Compare two files and return a unified diff with line counts to inspect changes or verify an edit dry-run against another file.

Instructions

Compare two files and return a unified diff with line counts. Pass the two paths as a and b. Use after an edit dry-run to compare against another file, or to inspect changes between two paths.

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

A4.2/5.0
Behavior4/5

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

Annotations already mark the tool as read-only and closed-world. The description adds useful behavioral detail by specifying the output form ('unified diff with line counts'). It does not contradict the annotations, and it offers enough beyond them for a safe read operation.

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 cover purpose, output format, parameter mapping, and usage context with no filler. The core action is front-loaded, and every sentence earns its place.

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 simple diff tool with read-only annotations, the description covers what it does, what it returns, and when to use it. There is no output schema, so the mention of unified diff and line counts provides the necessary return-value context. Minor gaps like failure behavior or path restrictions are not critical here.

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 coverage is 100%, so the parameters are already well documented. The description adds the instruction 'Pass the two paths as a and b,' which is a mild reinforcement but not substantial new meaning beyond 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 opens with a specific verb and resource: 'Compare two files and return a unified diff with line counts.' This clearly differentiates it from sibling read/list/stat tools, which inspect single paths rather than compare two files. The purpose is immediately recognizable.

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?

The description states explicit usage contexts: 'Use after an edit dry-run to compare against another file, or to inspect changes between two paths.' It does not name alternatives or exclusions, but the guidance is clear enough for an agent to decide when to invoke this tool.

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