{"uid":"cap_dCvdo8w4mzOeSHoJikUOy","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-c79b32d8","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":"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_iVmGoStJxxQfJ0Iu_595J","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 improperly formatted JSON strings (trailing commas, markdown fences, single quotes) from LLM outputs so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"This JSON string from my LLM output has trailing commas and markdown code fences and is breaking my pipeline — can you repair it and give me back valid, parseable JSON? Here it is: ```{name: 'Alice', age: 30,}```","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"My AI agent just returned this malformed JSON with single quotes and a trailing comma and now my downstream parser is crashing — can you repair it into valid JSON? Here's the raw string: {\"user\": 'Bob', \"score\": 98,}"},{"title":"Stripping markdown fences before parsing","prompt":"The LLM wrapped its JSON response in markdown code fences and it's breaking my automation — can you strip the fences and fix any other formatting issues so I get clean, parseable JSON back? Raw output: ```json\\n{\"status\": \"ok\",\\n}\\n```"},{"title":"Recovering truncated JSON from partial LLM response","prompt":"The model got cut off mid-response and I have a truncated JSON object that won't parse — can you repair and close it out so it's valid JSON I can actually use? Here's what I got: {\"items\": [{\"id\": 1, \"name\": \"widget\"}"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM formatting errors including trailing commas, markdown fences, single-quoted keys/values, and truncation issues — ready for downstream parsing without errors.","failureModes":["Input is so severely malformed that deterministic repair cannot recover a valid structure, returning an error response","JSON truncation is too deep or ambiguous to infer correct closing structure","Non-JSON content passed (e.g. plain prose) that cannot be coerced into valid JSON","Network timeout or service unavailability returning a 5xx error","Payment failure via x402 returning a 402 response"],"whenToPreferThis":"Choose this endpoint when you have LLM-generated or agent-produced JSON that fails standard parsing due to common formatting issues like trailing commas, markdown wrapping, single quotes, or truncation, and you need a deterministic (not AI-generated) repair rather than asking another LLM to fix it — especially valuable in multi-agent pipelines where JSON parsing failures would cascade.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:35:15.711Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}