diff_text
Compare two texts to produce unified line diffs or word and character changes, including similarity scores, counts, and hunks.
Instructions
utilpeek: Diff two texts: unified line diff, word or character changes. For PDF or Word files use compare_documents. Returns similarity, counts and hunks. Line mode returns a unified patch that preserves CRLF. Word and char modes return changes with exact character offsets. At most 1,000 hunks and 5,000 changes. Do not apply a truncated patch. 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
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The old text (at most 100,000 characters). | |
| b | Yes | The new text (at most 100,000 characters). | |
| mode | No | line (default; a unified diff), word or char (at most 20,000 characters per side). | line |
| context | No | Unchanged lines around each hunk. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| hunks | No | ||
| stats | No | ||
| source | No | ||
| changes | No | ||
| context | No | ||
| unified | No | ||
| identical | No | ||
| truncated | No | ||
| similarity | No |