# 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-1909455c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hPmLV8VGp4q4YhqJX9SSN

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-1909455c
```

Example prompt: The LLM just returned this broken JSON with trailing commas and a markdown code fence — can you repair it so I can parse it: ```json {"name": "Alice", "age": 30,} ```?

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives unpredictable JSON output that may contain syntax errors such as trailing commas, single quotes, markdown code fences, or truncation artifacts. It is especially valuable as a deterministic, rule-based repair layer before passing LLM responses to a JSON parser, avoiding pipeline crashes without needing another LLM call to fix formatting.

## Known failure modes

- Input is not recoverable JSON at all (random binary or plain text) — returns error or empty result
- Severely truncated input may lose data during repair
- Ambiguous structures may be repaired in an unexpected way
- Missing required raw_json parameter returns a 400/422 error
- Payment not completed (x402) returns a 402 Payment Required response

## 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 derived from the malformed input. The response includes the corrected JSON with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without crashes.

## 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-1909455c/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)
