# 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-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can process structured outputs without crashing.

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/v1/structured-output?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-aa8aa7be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gTW77yFNrfIBUXT7AGxO2

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

Example prompt: This JSON came back from the LLM but it has trailing commas and markdown code fences and won't parse — can you repair it so I can use it? Here's the raw string: ```json {"name": "Alice", "score": 42,} ```

## When to prefer this

Choose this endpoint when an AI agent or multi-agent pipeline receives LLM-generated JSON that fails to parse due to common syntax errors like trailing commas, markdown code fences, or single quotes. Ideal for real-time pipeline error recovery where crashing is unacceptable. Prefer this over manual regex heuristics or custom parsing logic when you need deterministic, reproducible repair with consistent behavior across all common LLM output failure modes.

## Known failure modes

- Input JSON too severely malformed to deterministically repair — ambiguous structure may yield unexpected output
- Empty or whitespace-only raw_json input returns an error
- JSON that is structurally valid but semantically incorrect is returned as-is without semantic correction
- Very long truncated JSON may have ambiguous closing structure leading to partial or incorrect repair

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

## Output

A repaired, valid JSON object with malformed syntax corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response is a JSON object ready for downstream parsing.

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