# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-10-21).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) into valid JSON so multi-agent pipelines don't crash.

## Facts

- Endpoint: GET https://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: agentdiet.dev
- Website: https://agentdiet.dev
- Canonical page: https://www.zero.xyz/c/agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aVSJ_iI22Z08-xmJFqc3p

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 agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439
```

Example prompt: This JSON from my LLM response is broken — it has trailing commas, markdown code fences, and single quotes — can you repair it into valid JSON? Here's the raw string: ```json {'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when an AI agent or multi-agent pipeline receives syntactically broken JSON from an LLM output stage — especially when the issues are common patterns like trailing commas, markdown code fences wrapping the JSON, single-quoted keys/values, or truncated strings. It is deterministic (not heuristic or ML-based), making it predictable and suitable for automated pipelines where consistency matters. Prefer this over writing custom regex fixes when you need reliable, repeatable JSON repair without maintaining your own parsing logic.

## Known failure modes

- Input JSON too severely malformed or truncated to infer correct structure — may return error or best-effort partial repair
- Empty or null raw_json input triggers validation error
- Non-JSON content (plain text, binary) passed as input returns parse failure
- Ambiguous truncation point where multiple valid completions exist — result may not match original intent
- Rate-limiting or payment failure (x402) if quota exceeded

## 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://agentdiet.dev/v1/repair)

## Output

A JSON object containing the repaired, syntactically valid version of the input. The malformed input is cleaned of issues such as trailing commas, markdown fences, single quotes, and truncation artifacts, returning a parseable JSON structure the agent can immediately use.

## 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/agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentdiet.dev](https://www.zero.xyz/host/agentdiet.dev/llms.txt)
