{"uid":"cap_RQGo8Jb0i3yPFYEUWnF9c","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-fbe4f2e7","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://whale-momentum.agentdiet.dev/v1/json-validator)","url":"https://whale-momentum.agentdiet.dev/v1/json-validator?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_LklruRvIVxt-phmOJaKry","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"whale-momentum.agentdiet.dev","brandSlug":"whale-momentum-agentdiet-dev-mpp","brandBaseUrl":"https://whale-momentum.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs malformed, truncated, or badly-formatted LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"My LLM just returned this broken JSON with trailing commas and markdown code fences — can you repair it so it's valid and parseable: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fix crashed multi-agent pipeline JSON","prompt":"Our agent pipeline just broke because the LLM returned JSON with trailing commas and single quotes instead of double quotes. Here's the bad output — can you repair it into valid JSON so we can keep processing: {\"status\": 'ok', \"items\": [1, 2, 3,]}"},{"title":"Strip markdown fences from LLM response","prompt":"The model returned its answer wrapped in a ```json ... ``` markdown block and our parser is choking on it. Can you clean it up and give me the valid JSON inside: ```json {\"result\": \"success\", \"count\": 5} ```"},{"title":"Recover truncated JSON from API timeout","prompt":"We hit a token limit mid-response and the JSON got cut off — it's missing closing brackets and braces. Can you deterministically repair this truncated JSON so it's complete and valid: {\"user\": {\"id\": 101, \"name\": \"Bob\", \"roles\": [\"admin\""}],"resultDescription":"Returns a JSON object containing the repaired, valid JSON string along with validation status, making the output safe to parse and pass downstream in agent pipelines.","failureModes":["Input JSON too severely malformed to deterministically repair — returns error indicating repair was not possible","Empty or null raw_json parameter — returns validation error","JSON structure is ambiguous after truncation — repair may make assumptions that differ from original intent","Rate limiting or payment failure via x402 — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting issues like trailing commas, markdown code fences, single quotes, or truncation. It is especially useful when deterministic repair (not AI re-generation) is needed to ensure consistency and avoid cascading failures in automated workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:35:19.412Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}