# 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-28).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.

## Facts

- Endpoint: POST https://x402-audit.agentdiet.dev/v1/json-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-28
- 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-b05c66e4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AGyLfwjFrmikrb0wkZ7CQ

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

Example prompt: This JSON came back from the LLM and it won't parse — there are trailing commas, single quotes, and a markdown code fence wrapping it. Can you run it through the JSON repair service and give me a clean, valid object I can use?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives malformed, truncated, or markdown-wrapped JSON from an LLM and needs a deterministic, paid-per-call repair service rather than a local library. Ideal for production agentic workflows where reliability matters and you want a battle-tested remote repair service with x402 micropayment support, especially if you're already using the agentdiet.dev B2A hub for other capabilities.

## Known failure modes

- Input is so corrupted that no valid JSON can be recovered — returns error with details
- Input JSON is empty or null — returns 400 validation error
- Payment not completed via x402 — returns HTTP 402 Payment Required
- Idempotency-Key collision with different payload — may return cached prior result
- Input exceeds size limits — returns 413 or similar error

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

## Output

Returns a repaired, valid JSON object parsed from the malformed input. The response contains the cleaned JSON with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed where possible.

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