# 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 JSON strings from LLM outputs so multi-agent pipelines can process them without crashing.

## Facts

- Endpoint: GET https://x402-audit.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: 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-e00cac5c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GrKd4Az6bnU3X3JqjBsg5

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

Example prompt: The LLM just returned this JSON with trailing commas and markdown fences and it's breaking my pipeline — can you fix it and give me back clean, valid JSON? Here's the raw output: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when an LLM or agent in your pipeline produces broken JSON that needs deterministic, rule-based repair rather than probabilistic re-generation. Ideal for multi-agent orchestration layers where reliability and consistency matter more than creative reinterpretation of malformed output.

## Known failure modes

- JSON too severely malformed to deterministically repair (ambiguous intent)
- Input string is not JSON at all (plain text or binary data)
- Truncation too extreme to infer missing structure
- Network timeout or service unavailability
- Payment failure via x402 protocol

## 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/structured-output)

## Output

A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures completed — 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-e00cac5c/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)
