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

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

## Facts

- Endpoint: POST https://onchain-risk.agentdiet.dev/v1/llm-json-schema-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-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-c80c84b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1GQLdaP83P_IljiFcU5Fu

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-c80c84b0 -d '<json body>'
```

Example prompt: I just got back a response from another LLM that looks like broken JSON — it has trailing commas, markdown code fences, and single quotes instead of double quotes. Can you run it through the JSON healer to get a clean, valid object back?

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails standard JSON.parse() due to LLM quirks like trailing commas, markdown fences, or single quotes, and you need a deterministic (non-AI) repair rather than asking another LLM to fix it. Ideal for production pipelines where reliability and predictability matter over creative reconstruction.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable JSON
- Empty or whitespace-only raw_json input — returns validation error
- Input that is not JSON at all (e.g. plain prose) — may return error or best-effort partial object
- Payment failure via x402 — returns HTTP 402 before processing

## 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/llm-json-schema-healer)

## Output

A repaired, valid JSON object parsed from the malformed input string, with all syntax errors corrected including 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/onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-c80c84b0/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)
