Diff
diffCompare two text files and produce a unified line-by-line comparison from a to b to identify changes between files on disk.
Instructions
Compare two text files and return a unified diff from a to b. Use when you need line differences between two files on disk. Do not use it to find text across files; use search_text instead. To preview your own pending change, use the dryRun option of the write tools. Binary and non-UTF-8 files fail. A file over the size limit fails with TOO_LARGE. So does a diff not done within 1 s, or a full diff queue; retry once, then read matching line ranges. Returns ---/+++ headers (basenames) and @@ hunks; identical files give headers only.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | Original file; its lines are the - side | |
| b | Yes | Changed file; its lines are the + side | |
| context | No | Unchanged lines shown around each hunk; output size only |