Skip to main content
Glama

Diff two texts

diff_text
Read-onlyIdempotent

Compare two texts by line, word, or character, or compare JSON so object key order does not matter. Returns an inline diff, side-by-side rows for line and JSON modes, and a unified patch.

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": {
      "left": "<left>",
      "right": "<right>"
    },
    "name": "diff_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
leftYesThe original text.
modeNoline
rightYesThe changed text.
ignoreWhitespaceNo

Output Schema

NameRequiredDescriptionDefault
okYes
rowsYes
unitYes
addedYes
errorYes
patchYes
piecesYes
removedYes
unchangedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds the output variety (inline diff, side-by-side rows for line/JSON modes, unified patch), but omits other behaviour such as how whitespace is handled by default or any size limits.

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?

A single front-loaded sentence that names the core action first, then the modes, then the return shapes; no filler. The trailing return-format clause overlaps somewhat with the existing output schema, so it earns slightly less than full marks.

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 4-parameter read-only tool with an output schema, the description covers purpose, modes and output types adequately. The remaining gap is the undocumented ignoreWhitespace flag, which an agent cannot interpret from the schema alone.

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?

At 50% schema coverage, the description usefully explains what the mode enum values mean, including the JSON key-order semantic that the schema enum alone does not convey. However, ignoreWhitespace is undocumented in both schema and description, and left/right semantics are already covered by 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?

States a specific verb (compare) and resource (two texts) and enumerates the four comparison modes, including the JSON key-order nuance. An agent can immediately tell this is a diffing tool distinct from neighbours like count_text or convert_case.

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 clear selection guidance for one mode ('compare JSON so object key order does not matter'), which implicitly tells the agent when json mode is appropriate. It does not state when-not to use the tool or name alternatives, and gives no guidance on choosing word vs char mode.

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.