# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from polymarket-odds.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-10-23).

Repairs malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) into valid, parseable JSON for multi-agent pipelines.

## Facts

- Endpoint: POST https://polymarket-odds.agentdiet.dev/v1/json-normalizer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Provider: polymarket-odds.agentdiet.dev
- Website: https://polymarket-odds.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-11c59f16
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3pObwctc89s--2ipbB2f7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-11c59f16 -d '<json body>'
```

Example prompt: This JSON came back from our LLM step and it's broken — trailing commas, single quotes, wrapped in a markdown code fence. Can you fix it so it parses cleanly? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based re-generation — it's ideal for multi-agent pipelines where reliability and consistency matter more than inference. Prefer it over retrying the LLM when the JSON structure is mostly intact but has common syntactic issues like trailing commas, markdown wrapping, or single quotes. Use it as a middleware layer between LLM output steps and downstream JSON consumers to prevent parse errors without adding latency or cost of another LLM call.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure
- Empty or whitespace-only raw_json string — rejected with validation error
- Input that is not JSON-like at all (plain prose, binary data) — may return error or empty result
- Rate limiting or payment issues with x402 protocol — returns 402 Payment Required
- Server timeout on extremely large malformed JSON strings

## How this service works

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://polymarket-odds.agentdiet.dev/v1/json-normalizer)

## Output

A JSON object containing the repaired, fully valid JSON. The response will be a parseable JSON structure derived from the input malformed string, with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "raw_json"
 ],
 "properties": {
  "raw_json": {
   "type": "string",
   "minLength": 1,
   "description": "Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/polymarket-odds-agentdiet-dev-deterministic-a2a-broken-json-repair-11c59f16/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from polymarket-odds.agentdiet.dev](https://www.zero.xyz/host/polymarket-odds.agentdiet.dev/llms.txt)
