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

Deterministically repairs malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, fence blocks) so multi-agent pipelines can process them without crashing.

## Facts

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

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

Example prompt: This JSON string came back from our LLM step and it's broken — it has trailing commas, markdown code fences, and single-quoted keys. Can you run it through the JSON normalizer to get back a clean, valid JSON object? Here it is: ```json\n{'name': 'Alice', 'score': 42,}\n```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than an LLM-based re-generation — it is predictable, cheap ($0.002/call), and safe for high-throughput multi-agent pipelines where LLM re-inference would be too slow or expensive. Prefer it when the malformation is structural (trailing commas, markdown fences, single quotes, truncation) rather than semantic. It also supports idempotent retries via an Idempotency-Key header, making it reliable in retry loops.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible, returning an error
- Input string is empty or not provided (minLength:1 enforced)
- JSON is ambiguous enough that multiple valid repairs exist, potentially returning an unexpected structure
- Network timeout or service unavailability at the x402 endpoint

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

## Output

A JSON object containing the repaired, normalized, and valid JSON — ready for downstream parsing. The response resolves structural issues such as trailing commas, markdown fences, single-quoted keys/values, and truncated structures, returning well-formed JSON that multi-agent pipelines can safely consume.

## 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-8c928d79/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)
