Skip to main content
Glama

MAD Synapse · Utils

Text diff

text_diff
Read-onlyIdempotent

Diff two texts: unified diff (patch format), a line/word-level change list, and similarity % — compare versions of a doc, config or code. jsdiff. mode=lines gives a unified patch; mode=words gives word-level changes for prose. Price: free. Errors: returns isError with a message for invalid input or an upstream failure (not charged).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesOriginal text.
bYesChanged text.
modeNoDiff granularity. One of "lines", "words". Default "lines".lines
contextNoUnchanged lines of context around each change in the patch. Range 0-20. Default 3.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
changesNo
unifiedNo
identicalNo
chars_addedNo
chars_removedNo
similarity_pctNo

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/non-destructive, but the description adds real behavioral context: pricing ("Price: free") and error behavior ("returns isError ... for invalid input or an upstream failure (not charged)"). It omits limits like input size caps, but the added error/cost disclosure is meaningful beyond annotations.

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?

Front-loads the core operation and outputs, then mode clarification, then price/error notes. Dense but each clause earns its place; the em-dash output list and shorthand "jsdiff" are slightly packed but not wasteful.

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?

With an output schema present, return values need not be explained. The description covers purpose, mode selection, cost, and error handling, leaving nothing an agent needs in order to call it correctly.

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. The description adds semantic value by explaining what each mode actually yields ("unified patch" vs "word-level changes for prose"), which the terse schema field does not convey, though it says nothing about context.

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 ("Diff two texts") and enumerates the three outputs (unified diff, line/word change list, similarity %), so an agent knows exactly what it produces. Among siblings like text_stats and markdown_convert, the diff-and-compare scope is unambiguous.

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 usage context ("compare versions of a doc, config or code") and routes mode selection ("mode=lines gives a unified patch; mode=words gives word-level changes for prose"). It lacks explicit when-not conditions or named alternatives, but the context is clear.

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