# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs malformed, truncated, or markdown-wrapped LLM JSON outputs deterministically so multi-agent pipelines can parse them without crashing.

## Facts

- Endpoint: GET https://llms-generator.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: llms-generator.agentdiet.dev
- Website: https://llms-generator.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/llms-generator-agentdiet-dev-deterministic-a2a-broken-json-repair-651a9ffa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8FJxVJsPtyz3Owg5D5UUH

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 llms-generator-agentdiet-dev-deterministic-a2a-broken-json-repair-651a9ffa
```

Example prompt: This JSON came back from the LLM with trailing commas and markdown code fences and it won't parse — can you clean it up and give me valid JSON? Here it is: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline is receiving JSON outputs that fail to parse due to common model-induced defects like trailing commas, markdown fences, or single quotes, and you need a deterministic (non-AI) repair that is fast, cheap, and reliable for pipeline automation. Prefer this over prompting the LLM again (slower, costlier, non-deterministic) or writing custom parsers.

## Known failure modes

- JSON too severely malformed or truncated to deterministically recover — returns error or best-effort partial result
- raw_json parameter missing or empty — returns 400 validation error
- Input is not JSON at all (e.g., plain prose) — may return error or unexpected output
- Payment not provided — returns HTTP 402 requiring x402 USDC micropayment
- Extremely large JSON strings may hit size limits

## 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://llms-generator.agentdiet.dev/v1/structured-output)

## Output

A repaired, valid JSON object that has had common LLM output defects corrected — including trailing commas, markdown code fences, single-quoted keys and values, and truncation artifacts — returned as a parseable JSON response body.

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