{"uid":"cap_6pdHLsN1rQrigGdTflY2M","slug":"sec-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-01a54acc","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://sec-intel.agentdiet.dev/v1/repair)","url":"https://sec-intel.agentdiet.dev/v1/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_-KgHoC2lW1NAB_XF991li","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"sec-intel.agentdiet.dev","brandSlug":"sec-intel-agentdiet-dev-mpp","brandBaseUrl":"https://sec-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) into valid, parseable JSON for use in multi-agent pipelines.","exampleAgentPrompt":"The LLM just returned this mangled JSON with trailing commas and markdown code fences — can you clean it up and give me a valid, parseable JSON object? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42, }```","exampleUseCases":[{"title":"Fix LLM output before pipeline handoff","prompt":"The language model returned this JSON but it has trailing commas and it's wrapped in a markdown code block — can you repair it so the next agent in the pipeline doesn't crash? Raw output: ```json\n{\"user\": 'bob', \"score\": 99, }\n```"},{"title":"Sanitize single-quoted JSON from chatbot","prompt":"My chatbot returned JSON using single quotes instead of double quotes and now my parser is throwing errors — can you fix this string into valid JSON: {'name': 'Alice', 'active': true}"},{"title":"Recover truncated JSON from partial LLM response","prompt":"The model got cut off mid-response and returned an incomplete JSON object — can you repair this truncated output and give me a valid JSON back: {\"items\": [{\"id\": 1, \"title\": \"Report\""}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned JSON with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial output","Input is not JSON at all (e.g. plain text or binary) — may return error indicating unrecognizable format","Truncation is too extreme to infer intended structure — output may differ from original intent","Missing required raw_json parameter — returns 400 or validation error","Payment not completed (HTTP 402) — request blocked until x402 payment is fulfilled"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that frequently contains syntax errors like trailing commas, markdown code fences, single-quoted keys, or truncated structures. It is particularly valuable in automated agent workflows where downstream tools require strictly valid JSON and crashing on malformed output is unacceptable. Prefer this over hand-rolled regex fixers when you need deterministic, reliable repair rather than probabilistic heuristics.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:07.051Z","isFirstParty":false,"canonicalSlug":"sec-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-01a54acc"}