# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from x402-audit.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 (trailing commas, single quotes, fenced code blocks) so multi-agent pipelines can continue without crashing.

## Facts

- Endpoint: GET https://x402-audit.agentdiet.dev/v1/schema-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: x402-audit.agentdiet.dev
- Website: https://x402-audit.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-abe00d9e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xJbqmBs1hCFAERmEwXked

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 x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-abe00d9e
```

Example prompt: This LLM response came back as broken JSON with trailing commas and markdown fences — can you repair it so I can parse it? Here's the raw string: ```{"name": "Alice", "score": 42,}```

## When to prefer this

Choose this endpoint when a multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common LLM syntax errors (trailing commas, single quotes, markdown fences, truncation). It is deterministic rather than probabilistic, making it preferable to asking another LLM to reformat the JSON. Use it as a middleware step between LLM output and any downstream agent or system that requires strict JSON compliance.

## Known failure modes

- JSON is too severely malformed to be deterministically repaired — endpoint may return an error or best-effort partial result
- Input string is empty or not JSON-like at all, failing the minLength:1 constraint
- Ambiguous truncation points may result in incomplete but technically valid JSON that loses data
- Network or payment (x402) errors may prevent the call from completing

## 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://x402-audit.agentdiet.dev/v1/schema-repair)

## Output

A repaired, schema-compliant JSON object that has been cleaned of common LLM-induced syntax errors including trailing commas, single-quoted keys/values, markdown code fences, and truncation artifacts — ready for deterministic parsing by downstream agents or systems.

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