# 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) into valid, parseable JSON deterministically.

## Facts

- Endpoint: GET https://onchain-risk.agentdiet.dev/v1/malformed-json-healer?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-c0a16aff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TQfbGIRdpePONn81KPkkA

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-c0a16aff
```

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

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated pipelines — especially when the malformation patterns are known (trailing commas, markdown fences, single quotes, truncation). Prefer it over LLM-based re-generation when you need reproducible, fast, low-cost fixes without hallucination risk.

## Known failure modes

- Input JSON is so severely malformed that repair is ambiguous or impossible — returns error
- Raw input string is empty or whitespace — returns validation error
- JSON structure is too deeply truncated to infer correct closing — may return partial or error
- Network/payment failure results in HTTP 402 or 5xx response

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

## Output

A JSON object containing the deterministically repaired, valid JSON — free of trailing commas, markdown fences, single-quote issues, and truncation artifacts, ready to parse 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/onchain-risk-agentdiet-dev-deterministic-a2a-broken-json-repair-c0a16aff/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)
