util_json_patch
JSON Patch / Merge Patch apply — Apply a patch to a JSON document, fully offline. Supports RFC 6902 JSON Patch (array of add, remove, replace, move, copy, test operations with RFC 6901 JSON Pointer paths incl. ~0/~1 escapes and the - array append) and RFC 7396 JSON Merge Patch (object: null deletes, objects merge recursively). Required: doc= (JSON text) and patch= (JSON text). Optional: mode=auto|json-patch|merge-patch (auto picks json-patch for an array, merge-patch for an object). Returns the patched result, whether anything changed, per-op steps and op counts. JSON Patch is atomic: a failed test or a bad path returns HTTP 422 with the failing operation index and reason (you are not charged). Up to 200,000 characters and 1,000 operations. Pairs with /v1/util/json-diff (which produces RFC 6902 patches). Price: $0.002 USDC (Base, via x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"doc": "<doc>",
"patch": "<patch>"
},
"name": "util_json_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | {"name":"Ada","tags":["math"]} | |
| patch | Yes | [{"op":"replace","path":"/name","value":"Ada Lovelace"},{"op":"add","path":"/tags/-","value":"computing"}] |