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

Deterministically repairs malformed, truncated, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines can parse and continue without crashing.

## Facts

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

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

Example prompt: This JSON came back from my LLM with trailing commas and markdown fences and it's breaking my pipeline — can you repair it and give me back valid JSON? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails to parse due to common LLM output artifacts — trailing commas, markdown code fences, single quotes, or truncation. It is especially valuable in automated pipelines where crashing on malformed JSON is unacceptable and you need a fast, deterministic (non-AI) fix rather than asking another LLM to re-generate the output.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns an error or best-effort partial result
- Input is not JSON at all (e.g. plain prose) — repair cannot produce valid output
- Extremely long truncated input may be cut off in ways that require guessing structure, leading to incorrect repair
- Query parameter encoding issues if the raw_json contains special characters not properly URL-encoded

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

## Output

Returns a JSON object containing the repaired, syntactically valid JSON — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing by agent pipelines.

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