# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from onchain-risk.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) deterministically so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: GET https://onchain-risk.agentdiet.dev/v1/schema-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: onchain-risk.agentdiet.dev
- Website: https://onchain-risk.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-3c167cca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wfYbyvMxOBB2HxI0uuNH2

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 onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-3c167cca
```

Example prompt: This LLM response came back with broken JSON — trailing commas, markdown fences, and single quotes — can you repair it so the pipeline doesn't crash? Here's the raw string: ```{"name": 'Alice', "score": 42,}```

## When to prefer this

Use this endpoint when you need deterministic, rule-based JSON repair for LLM outputs with known failure patterns (trailing commas, markdown fences, single quotes, minor truncation) and need a fast, cheap, per-call fix without relying on another LLM to re-parse the content. Prefer this over asking the LLM to retry when latency and cost matter, or when the same error pattern repeats across a pipeline.

## Known failure modes

- Input is so severely malformed it cannot be deterministically repaired (ambiguous structure) — returns an error or best-effort result
- Input is not JSON at all (plain text, binary) — may return an error indicating unparseable content
- Excessively long or nested JSON strings may hit query parameter length limits when passed via GET
- Truncated JSON with missing closing brackets may be repaired with assumptions that don't match original intent

## 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://onchain-risk.agentdiet.dev/v1/schema-repair)

## Output

A repaired, schema-compliant JSON object reconstructed from the malformed input. The response includes the corrected JSON string with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes replaced with double quotes, and any truncated structures closed appropriately.

## 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/onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-3c167cca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchain-risk.agentdiet.dev](https://www.zero.xyz/host/onchain-risk.agentdiet.dev/llms.txt)
