# 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.002000/call, status unknown (last checked 2026-10-23).

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

## Facts

- Endpoint: POST https://json-repair.agentdiet.dev/?utm_source=zero.xyz
- Price: $0.002000/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-23
- 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-7f5a16e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K2S1yknJZTiPZYvs10IRg

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

Example prompt: This LLM output came back with trailing commas, markdown code fences, and single quotes — can you repair it into valid JSON? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM re-generation — ideal for multi-agent pipelines where reproducibility and speed matter. Prefer it when the malformation is structural (trailing commas, markdown fences, single quotes, truncation) rather than semantic. Use it as a lightweight middleware layer between LLM output and downstream JSON consumers to eliminate crash loops.

## Known failure modes

- Input is so severely malformed that deterministic repair cannot infer intent — returns an error or best-effort partial result
- Empty or whitespace-only raw_json input triggers validation error
- Input contains non-JSON content (e.g. plain prose) with no recoverable structure
- Payment/402 failure if x402 credentials are missing or insufficient
- Network timeout if the endpoint is temporarily unavailable

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

## Output

Returns a repaired, valid JSON object parsed from the malformed input string, with all common LLM output issues resolved including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed properly.

## 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-7f5a16e5/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)
