# 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 truncated, malformed, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) so multi-agent pipelines can safely continue processing without crashes.

## Facts

- Endpoint: GET https://x402-audit.agentdiet.dev/v1/json-validator?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-d000b1cc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4R0_Rs7aePI6jzg2yV3bt

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-d000b1cc
```

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

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair (not probabilistic LLM re-generation) for broken outputs in multi-agent pipelines. It's ideal when you need predictable, fast sanitization of LLM-generated JSON before passing it downstream, especially for common failure patterns like trailing commas, markdown fences, and single quotes. Prefer this over retrying the LLM when cost, latency, or determinism matters.

## Known failure modes

- Input JSON too severely truncated to recover any valid structure — returns error or best-effort partial result
- Ambiguous repair cases where multiple valid completions exist may produce unexpected structure
- Very large JSON strings may exceed query parameter length limits when sent via GET
- Non-JSON content passed as input may return an error or empty result

## 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/json-validator)

## Output

A JSON object containing the deterministically repaired version of the input, with syntax errors corrected — trailing commas removed, single quotes converted to double quotes, markdown fences stripped, and truncated structures closed — ready for downstream parsing.

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