Text diff
text_diffDiff two texts: unified diff (patch format), a line/word-level change list, and similarity % — compare versions of a doc, config or code. jsdiff. mode=lines gives a unified patch; mode=words gives word-level changes for prose. Price: free. Errors: returns isError with a message for invalid input or an upstream failure (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 | Original text. | |
| b | Yes | Changed text. | |
| mode | No | Diff granularity. One of "lines", "words". Default "lines". | lines |
| context | No | Unchanged lines of context around each change in the patch. Range 0-20. Default 3. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changes | No | ||
| unified | No | ||
| identical | No | ||
| chars_added | No | ||
| chars_removed | No | ||
| similarity_pct | No |