Skip to main content
Glama

Text diff

text_diff
Read-onlyIdempotent

Compute a line-level diff between two strings. Returns a unified-style patch and per-line change list.

Returns: JSON line-diff with { added, removed, unchanged } arrays. Example input: {"a":"line 1\nline 2\nline 3","b":"line 1\nline 2 changed\nline 3"}

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": "text_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesOriginal text.
bYesModified text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnly, idempotent, closed-world), and the description adds real value beyond them by describing the return shape: a unified-style patch plus a per-line change list with added/removed/unchanged arrays. There is no output schema, so this disclosure matters. It loses a point because the two "Returns" sentences are slightly inconsistent about whether the output is a patch or categorized arrays.

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?

The purpose is front-loaded in the first sentence and the whole definition is three short lines with no filler. The duplicate "Returns" statements cost a point for slight redundancy.

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 two-string, read-only tool with no output schema, the description supplies what an agent needs: the comparison granularity, the return structure, and a concrete example. Nothing critical is missing, though edge-case behavior on empty input or trailing newlines is unstated.

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 description coverage is 100%, so the baseline is 3. The example input does add modest value by showing that newlines are embedded literally in the JSON strings and that `a` is the original and `b` the modified text, but it repeats rather than extends the schema's descriptions.

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?

"Compute a line-level diff between two strings" gives a specific verb (compute a diff), resource (two strings), and granularity (line-level). That distinguishes it reasonably from siblings like hash_compare or list_compare, though it never names them explicitly.

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 "line-level" qualifier implies this is for line-oriented text comparison rather than value or byte comparison, which is useful implied guidance. However, there is no explicit when-to-use statement and no mention of alternatives such as list_compare for set-style comparison.

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