Skip to main content
Glama

Text Analysis & Cleanup Tools (Tanod)

diff_text

Read-onlyIdempotent

utilpeek: Diff two texts: unified line diff, word or character changes. For PDF or Word files use compare_documents. Returns the differences between two texts: similarity ratio, counts and hunks; in line mode a git-compatible unified diff, in word or char mode change records (equal, insert, delete, replace) with exact character offsets into a and b. At most 1,000 hunks and 5,000 change records, then truncated. Parsed in an isolated, resource-limited child process without network; input over its limits is a 422 (not charged). Typically under 0.5 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored. Docs: https://tanod.dev/learn/text-diff-api.html

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

Input Schema

NameRequiredDescriptionDefault
aYesThe old text (at most 100,000 characters).
bYesThe new text (at most 100,000 characters).
modeNoline (default; a unified diff), word or char (at most 20,000 characters per side).line
contextNoUnchanged lines around each hunk.

Output Schema

NameRequiredDescriptionDefault
modeNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
hunksNo
statsNo
sourceNo
changesNo
contextNo
unifiedNo
identicalNo
truncatedNo
similarityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • removedInput schema / properties / a / title
      Removed value: -"A"
    • removedInput schema / properties / b / title
      Removed value: -"B"
    • changedInput schema / properties / context / description
      Previous value: -"Unchanged lines around each hunk (0-10, default 3)."New value: +"Unchanged lines around each hunk."
    • removedInput schema / properties / context / title
      Removed value: -"Context"
    • removedInput schema / properties / mode / title
      Removed value: -"Mode"
    • removedInput schema / title
      Removed value: -"diff_textArguments"
    • removedOutput schema / properties / changes / items
      Removed value: -{
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / hunks / items
      Removed value: -{
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / source / properties
      Removed value: -{
      -  "library": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "license": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / stats / properties
      Removed value: -{
      -  "a_units": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "b_units": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "deleted": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "inserted": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "unchanged": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "units": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "changes": {
      +      "items": {
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "context": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "hunks": {
      +      "items": {
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "identical": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "mode": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "similarity": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "properties": {
      +        "library": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "license": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "stats": {
      +      "properties": {
      +        "a_units": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "b_units": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "deleted": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "inserted": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "unchanged": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "units": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "truncated": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "unified": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. 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/closed-world, so the bar is lower, yet the description still adds substantial operational context: hunk and change-record caps with a `truncated` signal, isolated resource-limited child process with no network, 422 on oversized input and not charged, sub-0.5s latency, and no logging or storage of submitted text. The only mild detractor is that pricing/free-tier marketing is bundled into the same breath, but it is genuinely decision-relevant for cost-sensitive agents.

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?

Purpose and the sibling exclusion are front-loaded in the first two sentences, and the dense operational facts follow in a single block. It is on the long side and partly restates itself ('Diff two texts' then 'Returns the differences between two texts'), with pricing details that read as sales copy rather than tool semantics.

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?

Despite an output schema already existing, the description still summarizes return shape (similarity ratio, counts, hunks, change records, truncation flag), so an agent needs nothing else. Limits, error behavior, latency and safety posture are all covered for a low-complexity, four-parameter tool.

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 baseline is 3; the schema already documents a, b, mode (including the 20,000-character word/char limit) and context. The description adds only marginal meaning beyond that, notably that word/char modes return change records with exact character offsets into a and b, but it does not clarify `context` behavior in non-line modes.

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 first sentence gives a specific verb and resource plus all three output modes ('unified line diff, word or character changes'), and the second sentence explicitly routes document-format comparisons to the compare_documents sibling. An agent can identify this tool and separate it from compare_documents without consulting any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description names an alternative (compare_documents) and the condition that selects it (PDF or Word input), which is the classic when-not case for a plain-text diff. It also ties mode choice to output form (line = unified diff, word/char = change records), so the agent knows which mode to pick.

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.