diff_lines
Pack: diff · Endpoint: https://gateway.pipeworx.io/diff/mcp
Compute a line-level diff between two texts (keyless, offline). Returns the change list (equal/add/remove), an added/removed/unchanged summary, and a unified-diff-style string with +/- prefixes.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
a | string | yes | The original (“before”) text. |
b | string | yes | The new (“after”) text. |
context | boolean | no | If true, include unchanged lines in the unified output (default true). |
Example call
Arguments
{
"a": "line 1\nline 2\nline 3",
"b": "line 1\nline 2 modified\nline 3"
}
curl
curl -X POST https://gateway.pipeworx.io/diff/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"diff_lines","arguments":{"a":"line 1\nline 2\nline 3","b":"line 1\nline 2 modified\nline 3"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('diff_lines', {
"a": "line 1\nline 2\nline 3",
"b": "line 1\nline 2 modified\nline 3"
});
More examples
{
"a": "function foo() {\n return 42;\n}",
"b": "function foo() {\n console.log('called');\n return 42;\n}",
"context": true
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"diff": {
"url": "https://gateway.pipeworx.io/diff/mcp"
}
}
}
See Getting Started for client-specific install steps.