diff-patch-tools

v1.0.0
io.github.lazymac2x/diff-patch-tools Checked 15 hours ago Published 6 months ago

Cloudflare 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.

ParameterTypeDescription
modified *stringModified text
original *stringOriginal text
contextnumberContext lines around each change (default 3)
modified_filestringLabel for the modified file (default "modified")
original_filestringLabel for the original file (default "original")

json_diff

Compute a structural diff between two JSON values, showing added, removed, and replaced fields.

ParameterTypeDescription
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.

ParameterTypeDescription
original *stringOriginal text to patch
patch *stringUnified diff patch string

three_way_merge

Perform a three-way merge of base, ours, and theirs. Conflicts are marked with standard diff3 conflict markers.

ParameterTypeDescription
base *stringCommon ancestor text
ours *stringOur version of the text
theirs *stringTheir version of the text
ours_labelstringLabel for ours in conflict markers (default "ours")
theirs_labelstringLabel for theirs in conflict markers (default "theirs")

diff_stats

Parse a unified diff string and return line-level statistics: additions, deletions, hunks, files changed.

ParameterTypeDescription
diff *stringUnified diff string to analyse

patch_validate

Check whether a unified diff patch can be applied cleanly to an original text without actually applying it.

ParameterTypeDescription
original *stringOriginal text
patch *stringUnified diff patch string