utilpeek: diff two texts (line, word or character)
diff_textCompare two texts to get unified line diffs, word or character changes, similarity ratio, and exact change offsets for review or validation.
Instructions
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
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 (0-10, default 3). |
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 |