{"uid":"cap_VAtYZWGlAXyDZ4F6h7I_T","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-79c90814","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/structured-output)","url":"https://whale-momentum.agentdiet.dev/v1/structured-output?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_gTn0XOdDvB6YA1n_lut0a","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 truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) into valid, parseable JSON for multi-agent pipelines.","exampleAgentPrompt":"The LLM returned this broken JSON with trailing commas and markdown code fences — can you repair it into valid, parseable JSON? Here it is: ```json {\"name\": \"Alice\", \"score\": 42, } ```","exampleUseCases":[{"title":"Fixing LLM response in agent pipeline","prompt":"My AI agent just returned this malformed JSON with single quotes and a trailing comma — fix it so my pipeline doesn't crash: {'user': 'bob', 'status': 'active',}"},{"title":"Stripping markdown fences from structured output","prompt":"The model wrapped its JSON in triple backtick markdown fences and added extra text. Can you strip that out and give me clean, valid JSON? Here's the raw output: ```json\n{\"result\": \"ok\", \"count\": 5}\n```"},{"title":"Recovering truncated JSON from token limit cutoff","prompt":"This JSON got cut off mid-string because we hit the token limit — repair it as best you can into valid JSON: {\"items\": [{\"id\": 1, \"name\": \"Widget\"}, {\"id\": 2, \"name\": \"Ga"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input, with structural issues like trailing commas, markdown code fences, single quotes, and truncation corrected deterministically.","failureModes":["Input is so severely malformed or truncated that valid JSON cannot be inferred","Input contains deeply nested or ambiguous structures that are unresolvable","Empty or whitespace-only raw_json input returns an error","Non-JSON input (e.g. plain text, XML) may not be repairable","Schema validation failures if output does not match expected structure"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair of LLM outputs rather than probabilistic regeneration. Ideal for multi-agent pipelines where downstream systems require strictly valid JSON and LLM outputs frequently contain markdown fences, trailing commas, or single quotes. Prefer over re-prompting the LLM when you need fast, low-cost, predictable fixes without consuming additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:51.183Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}