Find differences between two texts by line, word or character
text_diffDifferences between two texts: mode lines, words or chars; the added, removed and unchanged parts with counts, a similarity ratio (2 x unchanged / both texts' units), and a unified diff for lines. Body { a, b, mode }: lines and words up to 50 KB each, chars up to 20 KB each (capped for the Worker's CPU budget). Pure code using the diff package (BSD-3-Clause). Related tools on this server, for a different need: text_chunk when you need to generate overlapping text chunks with character offsets; text_answer when you need answers a question from the given text only. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.
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
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | The first text (JSON body field) | |
| b | Yes | The second text (JSON body field) | |
| mode | No | lines (default), words or chars |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| parts | No | ||
| counts | No | ||
| source | No | ||
| checkedAt | No | ||
| identical | No | ||
| similarity | No | ||
| unifiedDiff | No | ||
| partsTruncated | No |