# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from json-repair.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) so multi-agent pipelines never crash.

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: json-repair.agentdiet.dev
- Website: https://json-repair.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-96fbcf33
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_r2pZX4ZAJ-z0xdkVWhMJ6

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

Example prompt: This JSON string from the LLM is broken — it has trailing commas and markdown code fences. Can you repair it deterministically so I can use it in the next pipeline step: ```{"name": "Alice", "age": 30,}```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that may be truncated, contain trailing commas, use single quotes, or be wrapped in markdown fences — and you need a deterministic (non-LLM) repair rather than asking another LLM to reformat it. Prefer this over ad-hoc regex fixes or prompting the LLM again when reliability and speed matter.

## Known failure modes

- Input is so severely malformed it cannot be deterministically repaired — returns error or partial result
- Non-JSON input (e.g. plain text or binary) passed as raw_json — endpoint may reject or return error
- Extremely large JSON strings may hit query parameter length limits when passed via GET
- Network or payment (x402) errors returning 402 if payment is not properly handled

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

## Output

Returns a repaired, valid JSON object where the malformed or truncated input has been deterministically fixed — trailing commas removed, markdown fences stripped, single quotes normalized, and any truncation completed — ready for downstream agent consumption.

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