# 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-21).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.

## Facts

- Endpoint: GET https://polymarket-odds.agentdiet.dev/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- 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-04fa33a5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uO1UdyE1je7LHtaXFDjUZ

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-04fa33a5
```

Example prompt: This JSON string from the LLM has trailing commas and markdown fences and is crashing my pipeline — can you repair it and give me back valid JSON? Here's the raw output: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated multi-agent pipelines where reliability and predictability matter more than AI-based guessing. Ideal when JSON malformations are known and systematic (trailing commas, markdown fences, single quotes, truncation) rather than semantic errors. Prefer over manual parsing hacks or LLM re-prompting when you need a cheap, fast, idempotent fix at $0.002 per call.

## Known failure modes

- raw_json parameter missing or empty — returns 400 error
- JSON is so severely malformed that deterministic repair cannot recover structure — returns error or best-effort partial result
- Payment not provided — returns HTTP 402 requiring x402 micropayment
- Input exceeds length limits — may return 413 or truncation error
- Non-JSON input passed (e.g. plain text, binary) — repair may fail or return unexpected result

## 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-validator)

## Output

A repaired, valid JSON object with all common malformation issues corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without errors.

## 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-04fa33a5/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)
