diff-patch-tools
v1.0.0Cloudflare Workers MCP server: diff-patch-tools
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
text_diff
Generate a unified diff between two text strings. Ideal for comparing file versions before and after edits.
| Parameter | Type | Description |
|---|---|---|
modified * | string | Modified text |
original * | string | Original text |
context | number | Context lines around each change (default 3) |
modified_file | string | Label for the modified file (default "modified") |
original_file | string | Label for the original file (default "original") |
json_diff
Compute a structural diff between two JSON values, showing added, removed, and replaced fields.
| Parameter | Type | Description |
|---|---|---|
modified * | Modified JSON value (object, array, or JSON string) | |
original * | Original JSON value (object, array, or JSON string) |
apply_patch
Apply a unified diff patch to an original text and return the patched result.
| Parameter | Type | Description |
|---|---|---|
original * | string | Original text to patch |
patch * | string | Unified diff patch string |
three_way_merge
Perform a three-way merge of base, ours, and theirs. Conflicts are marked with standard diff3 conflict markers.
| Parameter | Type | Description |
|---|---|---|
base * | string | Common ancestor text |
ours * | string | Our version of the text |
theirs * | string | Their version of the text |
ours_label | string | Label for ours in conflict markers (default "ours") |
theirs_label | string | Label for theirs in conflict markers (default "theirs") |
diff_stats
Parse a unified diff string and return line-level statistics: additions, deletions, hunks, files changed.
| Parameter | Type | Description |
|---|---|---|
diff * | string | Unified diff string to analyse |
patch_validate
Check whether a unified diff patch can be applied cleanly to an original text without actually applying it.
| Parameter | Type | Description |
|---|---|---|
original * | string | Original text |
patch * | string | Unified diff patch string |