# 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 never crash

## Facts

- Endpoint: POST https://preflight.agentdiet.dev/v1/structured-output?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-947f01f0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bwM7OrqCb8JYpl2Ay-f3K

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

Example prompt: The LLM just returned this broken JSON string with trailing commas and markdown fences — can you repair it so it's valid and parseable: ```{"name": "Alice", "score": 42,}```?

## When to prefer this

Choose this endpoint when your agent pipeline receives structured output from LLMs that may contain common JSON syntax errors such as markdown code fences, trailing commas, single quotes, or truncation. It is ideal for hardening multi-agent workflows where downstream steps require strict JSON parsing and crashes must be avoided. Prefer this over manual regex cleaning or custom parsers when you need deterministic, reliable repair without writing custom sanitization logic.

## Known failure modes

- Input is so severely malformed that repair is not deterministically possible, returning an error
- Input string is empty or below minimum length
- JSON is ambiguous in its truncation point, leading to uncertain repair outcomes
- Network or service timeout for unusually large payloads

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

## Output

A repaired, syntactically valid JSON object derived from the malformed input. The response contains the corrected structure with all detectable issues resolved, including removal of markdown fences, fixing trailing commas, converting single quotes to double quotes, and closing truncated strings or brackets.

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