{"uid":"cap_sS_Z2P0y4wURq8qa6YT5b","slug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-0e28f468","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://prompt-guard.agentdiet.dev/v1/json-normalizer)","url":"https://prompt-guard.agentdiet.dev/v1/json-normalizer?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_5TMBzpHnmcHXDj86fHRMa","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"prompt-guard.agentdiet.dev","brandSlug":"prompt-guard-agentdiet-dev-mpp","brandBaseUrl":"https://prompt-guard.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":"Can you fix this broken JSON from the last LLM call — it has trailing commas and markdown code fences wrapping it, and my pipeline is crashing on it: ```json {\"name\": \"Alice\", \"score\": 42,} ```","exampleUseCases":[{"title":"LLM output normalization in agent pipeline","prompt":"The upstream agent just returned this JSON with trailing commas and single-quoted keys and my next step is failing — can you repair it so it's valid? Here's the raw string: {'name': 'Bob', 'items': ['a', 'b',]}"},{"title":"Stripping markdown fences from model response","prompt":"My model wrapped its JSON in a markdown code block again and now my parser is throwing an error. Can you strip the fences and normalize it? The raw output is: ```json\n{\"result\": \"ok\",}\n```"},{"title":"Fixing truncated JSON from streaming response","prompt":"I got a streaming response that got cut off mid-object and now the JSON is incomplete — something like {\"user\": \"carol\", \"data\": {\"score\". Can you repair it so it's parseable?"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned, schema-compliant JSON that can be safely parsed and passed to downstream pipeline steps without crashing.","failureModes":["Input JSON too severely truncated to infer structure — may return partial or best-effort repair","Ambiguous structure where multiple valid completions exist — repair may not match original intent","Very large payloads may exceed query parameter length limits since input is passed via GET query string","Non-JSON input that is fundamentally not JSON-like may return an error or empty result"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may contain markdown fences, trailing commas, single quotes, or truncation artifacts and you need a deterministic, low-latency fix before passing data downstream. It is especially valuable in agentic workflows where LLM output is unpredictable and pipeline stability is critical. Prefer it over writing custom regex-based fixups or retrying the LLM, as it provides consistent repair logic without additional token costs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:21.532Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-9a6e7e44"}