Diff Files
diff_filesGenerate a unified diff between two files. Use the output with apply_patch to apply changes. Returns isIdentical=true when files match, meaning no patch is required.
Instructions
Generate a unified diff between two files. Output feeds directly into apply_patch. isIdentical=true means files match — no patch needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| original | Yes | Path to original file | |
| modified | Yes | Path to modified file | |
| context | No | Lines of context to include in the diff | |
| ignoreWhitespace | No | Ignore leading/trailing whitespace when comparing lines | |
| stripTrailingCr | No | Strip trailing carriage returns before diffing |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| diff | No | Unified diff content | |
| isIdentical | No | True if files are identical | |
| linesAdded | No | Lines added | |
| linesRemoved | No | Lines removed | |
| hunksCount | No | Number of diff hunks | |
| truncated | No | Diff content truncated? | |
| resourceUri | No | Full diff content URI |