{"uid":"cap_wfYbyvMxOBB2HxI0uuNH2","slug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-3c167cca","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://onchain-risk.agentdiet.dev/v1/schema-repair)","url":"https://onchain-risk.agentdiet.dev/v1/schema-repair?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_R0fBDlT5lm89XsAHfwtYm","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"onchain-risk.agentdiet.dev","brandSlug":"onchain-risk-agentdiet-dev-mpp","brandBaseUrl":"https://onchain-risk.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) deterministically so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"This LLM response came back with broken JSON — trailing commas, markdown fences, and single quotes — can you repair it so the pipeline doesn't crash? Here's the raw string: ```{\"name\": 'Alice', \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM JSON before pipeline handoff","prompt":"The model just returned this malformed JSON with trailing commas and a markdown code fence — fix it so I can pass it to the next agent without crashing: ```json\n{\"user\": 'Bob', \"items\": [1, 2,],}```"},{"title":"Recover truncated agent response","prompt":"My agent's response got cut off mid-JSON and now nothing downstream can parse it. Here's the broken string: {\"result\": \"success\", \"data\": {\"id\": 99, \"tags\": [\"a\", \"b\" — can you repair it into valid JSON?"},{"title":"Sanitize single-quote JSON from legacy model","prompt":"I'm getting JSON back from an older model that uses single quotes instead of double quotes and has trailing commas everywhere. Can you clean up this string into valid JSON? {'status': 'ok', 'count': 5,}"}],"resultDescription":"A repaired, schema-compliant JSON object reconstructed from the malformed input. The response includes the corrected JSON string with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes replaced with double quotes, and any truncated structures closed appropriately.","failureModes":["Input is so severely malformed it cannot be deterministically repaired (ambiguous structure) — returns an error or best-effort result","Input is not JSON at all (plain text, binary) — may return an error indicating unparseable content","Excessively long or nested JSON strings may hit query parameter length limits when passed via GET","Truncated JSON with missing closing brackets may be repaired with assumptions that don't match original intent"],"whenToPreferThis":"Use this endpoint when you need deterministic, rule-based JSON repair for LLM outputs with known failure patterns (trailing commas, markdown fences, single quotes, minor truncation) and need a fast, cheap, per-call fix without relying on another LLM to re-parse the content. Prefer this over asking the LLM to retry when latency and cost matter, or when the same error pattern repeats across a pipeline.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:22.008Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-2ee0e1c0"}