# 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 JSON for use in multi-agent pipelines

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/v1/json-fix?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-6738d24c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pkM4GbLNfBphniSUe90Xr

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-6738d24c
```

Example prompt: This JSON came back from the LLM and it's broken — it has trailing commas, markdown fences, and single quotes everywhere. Can you fix it so it's valid JSON I can use? Here it is: ```json {'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives malformed JSON that needs deterministic, rule-based repair rather than LLM-based regeneration — especially when you need fast, cheap, and reliable fixing of common LLM output artifacts like trailing commas, markdown fences, and single quotes. Prefer this over asking the LLM to reformat its own output, which is slower and costs more tokens.

## Known failure modes

- Input string is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial result
- Non-JSON input (e.g. plain text, binary) passed as raw_json — may return an error or unexpected output
- Extremely long or deeply nested JSON may exceed processing limits
- Missing required raw_json parameter — returns 400 bad request
- Payment not completed via x402 — returns 402 Payment Required

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

## Output

A JSON object containing the repaired, valid JSON — transformed from the malformed input by fixing issues such as trailing commas, markdown code fences, single quotes, and truncated structures into well-formed, parseable JSON.

## 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-6738d24c/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)
