{"uid":"cap_qcs_uex89fV94izpPBU2n","slug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-4a2b8437","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://mesh.agentdiet.dev/v1/malformed-json-healer)","url":"https://mesh.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz","method":"GET","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_Bettf3sYWYbApvauXxt0Z","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) to prevent multi-agent pipeline crashes","exampleAgentPrompt":"This JSON from the LLM response is broken — it has trailing commas and markdown code fences wrapping it — can you repair it into valid JSON? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"The agent downstream just errored out because the upstream model returned JSON with trailing commas and single quotes instead of double quotes — can you fix this raw string into valid JSON so the pipeline can continue? Here's the broken output: {'name': 'Bob', 'items': [1, 2, 3,]}"},{"title":"Stripping markdown fences from model output","prompt":"My LLM wrapped its JSON response in triple-backtick markdown fences and now my parser is choking on it — can you strip the fences and return clean valid JSON? Raw output: ```json\n{\"status\": \"ok\", \"data\": [1,2,3]}\n```"},{"title":"Recovering truncated JSON from token cutoff","prompt":"The model hit its token limit mid-response and the JSON got cut off partway through — can you repair this truncated JSON string and close it properly so I can use it downstream? Here it is: {\"results\": [{\"id\": 1, \"value\": \"foo\"}, {\"id\": 2, \"val"}],"resultDescription":"Returns a repaired, syntactically valid JSON object. The malformed input string is deterministically corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — yielding a parseable JSON payload safe for downstream agent or pipeline consumption.","failureModes":["Input is so severely malformed that deterministic repair cannot reconstruct intent — returns error or best-effort partial repair","Input is not JSON at all (e.g. plain prose) — endpoint may return error or unexpected output","Very long truncated JSON where closing structure is ambiguous — reconstruction may not match original intent","Payment/402 flow fails if USDC funds are insufficient or x402 protocol is misconfigured"],"whenToPreferThis":"Choose this endpoint when an AI agent or LLM pipeline produces JSON that fails to parse due to common LLM formatting errors like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (not a generative re-write), making it safe and predictable for production pipelines. Prefer it over prompt-engineering retries when latency and token cost matter, or when the source model is not accessible for a follow-up call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:11.364Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ae3fa643"}