{"uid":"cap_0vzK5CYwcUp2m347SQBqL","slug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-b2498355","name":"Deterministic A2A Broken-JSON Repair & Schema Validator","description":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. (Live x402 v2, IETF MPP & MCP endpoint at https://mcp-security.agentdiet.dev/v1/json-repair)","url":"https://mcp-security.agentdiet.dev/v1/json-repair?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["raw_json"],"properties":{"raw_json":{"type":"string","minLength":1,"description":"Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"}}},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.002","displayCostAsset":"USD","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.002/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8BSjVq7dfEqiC3K82j5g-","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mcp-security.agentdiet.dev","brandSlug":"mcp-security-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-security.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) into valid JSON to prevent multi-agent pipeline crashes.","exampleAgentPrompt":"This JSON string came back from an LLM and it's malformed — it has trailing commas, single quotes, and a markdown code fence wrapper. Can you repair it into valid JSON? Here it is: ```json {'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"The JSON my AI assistant returned has trailing commas and single quotes and it's breaking my database insert — can you repair this string into valid JSON: {'user': 'bob', 'score': 42,}"},{"title":"Strip markdown fences from agent response","prompt":"My pipeline received a JSON wrapped in a markdown code block like ```json {\"items\": [1,2,3,]} ``` and it's causing a parse error — please repair it into clean valid JSON."},{"title":"Recover truncated API response JSON","prompt":"One of my upstream agents returned a truncated JSON response that ends mid-string: {\"status\": \"ok\", \"data\": {\"result\": \"proc — can you deterministically repair this so my workflow doesn't crash?"}],"resultDescription":"A JSON object containing the repaired, fully valid JSON output derived from the malformed input string. The response corrects issues such as trailing commas, markdown code fences, single-quoted keys/values, and truncation so downstream agents and parsers can consume it without errors.","failureModes":["Input JSON is so severely malformed or corrupted that repair is not deterministically possible — returns error response","Empty or missing raw_json field triggers schema validation error","JSON that is semantically ambiguous after truncation may be repaired in an unexpected way","Rate limiting or payment (x402) failure if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated or third-party JSON that may be malformed, truncated, or wrapped in markdown, and you need a deterministic (not AI-guessing) fix before passing it downstream. Prefer this over writing custom regex or using an LLM to re-parse, since deterministic repair is faster, cheaper, and consistent across retries. Especially useful in automated pipelines where crashes from bad JSON are unacceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:40:01.956Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-fe1334e3"}