Skip to main content
Glama

Agent Data Hub

Text diff: compare two versions (unified diff)

util_diff
Read-onlyIdempotent

Compare two texts and see exactly what changed. Line mode returns a standard unified diff (git-style @@ hunks) plus a list of added/removed lines with line numbers; word or char mode returns equal/insert/delete segments. Also: counts and a 0–1 similarity score, optional ignore case/whitespace. Myers algorithm, up to 20,000 characters and 5,000 lines per side. Use to detect page/contract/price changes or to review an edit. Price: $0.001 per call (USDC on Base via x402); the first 10 calls per day are free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "b": "<b>"
    },
    "name": "util_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesOld/original text
bYesNew/changed text
modeNolines (default), words or chars
contextNoUnchanged lines around each change, 0–20 (default 3)
ignore_caseNotrue to ignore case
ignore_whitespaceNotrue to ignore whitespace differences

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, and the description goes well beyond them by disclosing hard limits (20,000 characters and 5,000 lines per side), the algorithm (Myers), and the cost model ($0.001 per call, first 10/day free). It does not discuss truncation behavior when limits are exceeded or error cases, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences, front-loaded with the core behavior before mode details, limits and pricing. Nothing is redundant, though the pricing clause is tacked onto the end rather than separated, making the final sentence carry two unrelated ideas.

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?

There is no output schema, and the description compensates by describing the return values for each mode (hunks, line lists, segments, counts, 0–1 similarity score) plus the size limits that affect results. An agent has everything needed to call it and interpret the response.

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%, so the baseline is 3, but the description adds real meaning by tying the mode parameter to distinct output shapes and noting the optional ignore case/whitespace toggles. It does not elaborate on the context parameter's 0–20 range or clarify why the boolean-like flags are typed as strings.

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?

States a specific verb and resource ("Compare two texts") and immediately specifies what each mode returns: unified diff with @@ hunks and added/removed line numbers for line mode, equal/insert/delete segments for word/char mode. An agent can distinguish this from util_text_stats or util_hash purely from the description.

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?

Gives concrete use cases ("detect page/contract/price changes or to review an edit") that tell the agent when this tool applies. It does not name an alternative or state when not to use it, so it stops short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources