Content is loading…
Generate a unified diff patch between two texts with addition/deletion stats.
unified_diff#diff#patch#unified diff#compare#text comparisonGenerate a unified diff between oldText and newText to identify specific changes. Accepts optional labels for file headers, a context line count, and a boolean to ignoreWhitespace. Returns the formatted patch string along with total addition, deletion, and hunk counts.
| Name | Type | Required | Description |
|---|---|---|---|
oldText | string | required | The original (old) text |
newText | string | required | The modified (new) text |
oldLabel | string | optional | Filename label for the old side. Default "a" |
newLabel | string | optional | Filename label for the new side. Default "b" |
context | number | optional | Context lines around changes. Default 3. |
ignoreWhitespace | boolean | optional | Ignore whitespace-only changes. Default false. |
{
"oldText": "port: 3000\ndebug: true\n",
"newText": "port: 8080\ndebug: true\n",
"oldLabel": "config.yml",
"newLabel": "config.yml"
}curl -X POST https://toolsy.my/api/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "unified_diff",
"arguments": {
"oldText": "port: 3000\ndebug: true\n",
"newText": "port: 8080\ndebug: true\n",
"oldLabel": "config.yml",
"newLabel": "config.yml"
}
}
}'Generate a free API key or set up an OAuth connector for Claude.ai.