# 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 or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can safely parse downstream responses.

## Facts

- Endpoint: POST https://preflight.agentdiet.dev/v1/repair?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-a99cc8ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gS8OXXoDDRBftcxHRZLPB

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

Example prompt: This JSON response I got from the LLM is broken — it has trailing commas, single quotes, and markdown fences wrapping it. Can you fix it so I can parse it properly: ```{name: 'Alice', age: 30,}```?

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based reformatting — ideal for multi-agent pipelines where consistency and reproducibility matter. Prefer this over prompt-based repair when you need guaranteed idempotency (via Idempotency-Key header) and low latency. Best suited for fixing common LLM output artifacts like trailing commas, markdown fences, and single quotes rather than deeply restructuring semantically incorrect data.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure
- Input is not JSON-like at all (e.g. plain prose) — returns validation error
- Empty or whitespace-only raw_json input — returns 400-style error
- Truncation is too severe to infer closing structure — returns partial repair or failure notice

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

## Output

A repaired, schema-compliant JSON object derived from the malformed input. The response contains the fixed JSON ready for downstream parsing, with all syntax errors (trailing commas, markdown fences, single quotes, truncation) resolved deterministically.

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