# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from preflight.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-11-21).

Repairs truncated, malformed, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines never crash on bad JSON.

## Facts

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

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 preflight-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-5aa3b29e -d '<json body>'
```

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

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline is receiving malformed JSON outputs — especially those with trailing commas, markdown code fences, single quotes, or truncation — and you need a deterministic, rule-based repair rather than asking another LLM to guess at the fix. It is ideal for production pipelines where reliability and consistency matter more than probabilistic correction, and for cases where you need cheap, fast, non-AI JSON healing at $0.002 per call.

## Known failure modes

- Input JSON is too severely corrupted to deterministically repair — returns an error indicating repair was not possible
- Input string is empty or whitespace — rejected with minLength validation error
- Ambiguous structure where multiple valid repairs exist — may return best-guess repair or error
- Payment not provided or insufficient — returns HTTP 402 requiring x402 USDC payment
- Network timeout or service unavailability — returns 5xx error

## 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://preflight.agentdiet.dev/v1/llm-json-schema-healer)

## Output

A JSON object containing the repaired, valid JSON output. The malformed input string is deterministically fixed — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, truncated structures closed — and returned as parseable, schema-valid JSON ready for downstream agent consumption.

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