{"uid":"cap_5AoYBzh64f-NfXHoWv84t","slug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-121035a0","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://arxiv-digest.agentdiet.dev/v1/schema-repair)","url":"https://arxiv-digest.agentdiet.dev/v1/schema-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_B-lubEZl0NnuzIF7hU424","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"arxiv-digest.agentdiet.dev","brandSlug":"arxiv-digest-agentdiet-dev-mpp","brandBaseUrl":"https://arxiv-digest.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.","exampleAgentPrompt":"This JSON from the LLM came back malformed with trailing commas and markdown fences — can you repair it so it parses correctly: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM JSON in agent pipeline","prompt":"The language model returned this broken JSON with a trailing comma and single-quoted keys — repair it so our pipeline doesn't crash: {'name': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from JSON output","prompt":"Our LLM wrapped its JSON response in markdown code fences again. Can you clean this up and give me valid parseable JSON? Here's the raw output: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3],}\n```"},{"title":"Recover truncated JSON from LLM response","prompt":"The model got cut off mid-response and the JSON is truncated — it ends with '{\"user\": \"carol\", \"role\": \"adm'. Can you repair it into valid JSON as best you can?"}],"resultDescription":"A repaired, valid JSON object that has been sanitized of common LLM output defects including trailing commas, markdown code fences, single-quoted keys/values, and truncation artifacts — ready for immediate use in downstream agent pipeline steps.","failureModes":["Input JSON is so severely malformed that deterministic repair is not possible — returns error indicating unrecoverable structure","Empty or null raw_json input — returns validation error","Input exceeds maximum string length limits — returns size error","JSON structure is ambiguous after repair — may return best-effort result with warnings"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that fails standard JSON.parse() due to common defects like trailing commas, markdown fences, or single quotes. Prefer it over writing custom regex sanitizers or retry logic, especially when you need deterministic, low-latency repair at $0.002/call without burning additional LLM tokens on reformatting requests.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:37:53.598Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-859b9028"}