# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from json-repair.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 so multi-agent pipelines never crash.

## Facts

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

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 json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-5b6d2501
```

Example prompt: This LLM response came back as broken JSON with trailing commas and markdown fences — can you repair it so I can parse it? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails JSON.parse due to common issues like trailing commas, markdown code fences, single quotes, or truncation. It is purpose-built for agentic workflows where LLM outputs must be reliably parsed before being handed off to the next stage. Prefer it over writing custom regex fixes or retry loops for malformed JSON.

## Known failure modes

- Input string is so malformed it cannot be deterministically repaired, returning an error or best-effort partial result
- Empty or null raw_json input triggers a validation error
- Payment failure via x402 prevents the request from being processed
- Extremely long or deeply nested malformed JSON may time out or return incomplete repairs

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

## Output

A valid, repaired JSON object with the malformed input cleaned up: trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response schema is a generic JSON object containing the repaired output.

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