{"uid":"cap_KWGUBM854ulbqcZliKYno","slug":"agent402-uk-json-patch-010c01c2","name":"Agent402 UK JSON Patch","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/utils/json/patch","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"patch":{"type":"array","description":"RFC 6902 ops array (max 100)"},"document":{"type":"object","description":"JSON document to patch"}}},"responseSchema":{"type":"json","example":{"valid":true,"document":{"a":3,"b":{"c":2,"d":4}},"ops_applied":2}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JfrmSMG8BvhTB_dR0hMRz","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Applies RFC 6902 JSON Patch operations (add/remove/replace/move/copy/test) to a JSON document atomically, returning the patched result.","exampleAgentPrompt":"Take this JSON document {\"a\":1,\"b\":{\"c\":2}} and apply these RFC 6902 patch operations: first replace the value of 'a' with 3, then add a new key 'd' with value 4 under 'b' — give me back the updated document.","exampleUseCases":[{"title":"Incremental agent state update","prompt":"I have my agent's current state object and I just need to update the 'status' field to 'running' and add a 'last_updated' timestamp — can you apply those two patch ops without me rewriting the whole blob?"},{"title":"Atomic config field removal","prompt":"Remove the 'debug_mode' key and replace the 'max_retries' value with 5 in this config JSON, but only if 'version' is currently '2' — do it atomically so if the test fails nothing changes."},{"title":"Nested value relocation","prompt":"In this JSON document, move the 'metadata.author' field up to the top level as 'author', and copy 'metadata.created_at' to 'audit.created_at' — here are the patch ops to apply."}],"resultDescription":"Returns a JSON object with a 'valid' boolean indicating success, the fully patched 'document' object with all operations applied, and an 'ops_applied' integer count of how many patch operations were executed. On failure the operation is atomic — no partial changes are applied.","failureModes":["Patch operation fails test assertion — entire patch is rolled back, valid=false returned","More than 100 ops in the patch array — request rejected","Malformed RFC 6902 op (missing 'op', 'path', or 'value' fields) — validation error","Invalid JSON Pointer path referencing a non-existent location for remove/replace — patch fails atomically","Document or patch not provided in request body — bad request error"],"whenToPreferThis":"Choose this endpoint when you need to make targeted, surgical updates to a JSON document without transmitting or rewriting the entire payload — especially for agent state management, incremental config updates, or any scenario requiring atomic all-or-nothing application of multiple changes. Prefer it over manual field-by-field updates when you have structured RFC 6902 patch arrays ready, or when you need the 'test' operation to guard against concurrent modifications. It is deterministic and pure (no side effects), making it safe for repeated use in agentic loops.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:48:05.732Z","isFirstParty":false}