# 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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, code fences) into valid JSON so multi-agent pipelines don't crash.

## Facts

- Endpoint: POST https://onchain-risk.agentdiet.dev/v1/json-normalizer?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-4c25d268
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vkKA9VOb2gbr2OH3pFaup

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

Example prompt: This LLM output came back as broken JSON with markdown fences and trailing commas — can you repair it and give me back valid JSON? Here it is: ```json {"name": "Alice", "score": 42,} ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives raw LLM JSON outputs that frequently contain trailing commas, markdown fences, single quotes, or truncation — and you need a deterministic (non-AI) repair rather than asking another LLM to fix it, which risks introducing hallucinations or changing content.

## Known failure modes

- Input JSON is too severely malformed to deterministically recover (e.g. missing entire structural sections)
- Ambiguous repair paths where multiple valid interpretations exist may produce unexpected output
- Empty or whitespace-only input returns an error
- Payment (x402) not included or invalid USDC balance causes 402 response 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/json-normalizer)

## Output

A repaired, valid JSON object that has been cleaned of common LLM-introduced defects including trailing commas, markdown code fences, single quotes, and truncation artifacts — ready for downstream parsing and use.

## 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-4c25d268/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)
