Text apply unified patch

text-apply-unified-patch · version 1.0.0 · Text · free, no key needed

Apply a one-file unified patch to text at original line addresses with exact hunk matches.

Use when you need to: text apply unified patch · apply unified diff to text · apply a unified patch exactly.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "text": "a\nb\n",
  "unified": "--- a\n+++ b\n@@ -1,2 +1,2 @@\n a\n-b\n+c\n"
}

Response:

{
  "result": {
    "text": "a\nc\n",
    "identical": false
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "text-apply-unified-patch",
  "version": "1.0.0",
  "input": {
    "text": "a\nb\n",
    "unified": "--- a\n+++ b\n@@ -1,2 +1,2 @@\n a\n-b\n+c\n"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/text-apply-unified-patch/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"a\nb\n","unified":"--- a\n+++ b\n@@ -1,2 +1,2 @@\n a\n-b\n+c\n"}'

The machine-readable contract is at /v1/tools/text-apply-unified-patch/versions/1.0.0.

CLI

node cli.mjs run text-apply-unified-patch 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.