# 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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fenced code blocks) so multi-agent pipelines never crash on bad LLM output.

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/v1/malformed-json-healer?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-4cf141d4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T_jro0PF4e-U6lyd44EZr

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-4cf141d4
```

Example prompt: This LLM response came back with trailing commas and markdown code fences around the JSON — can you clean it up and give me valid, parseable JSON? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting issues like trailing commas, markdown fences, single quotes, or truncation. It is purpose-built for deterministic (non-probabilistic) repair, making it reliable for automated pipelines where consistency matters. Prefer it over ad-hoc regex fixes or re-prompting the LLM when you need a fast, cheap, and predictable correction step.

## Known failure modes

- Input so severely malformed that no deterministic repair is possible — returns error or best-effort partial result
- Ambiguous truncation where the intended structure cannot be inferred — may produce incorrect but syntactically valid JSON
- Very large JSON strings may hit query parameter length limits when passed via GET
- Empty or whitespace-only raw_json input — likely returns validation error

## 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/malformed-json-healer)

## Output

A repaired, valid JSON object derived from the malformed input string. The endpoint deterministically corrects issues such as trailing commas, missing brackets, markdown fences, single quotes, and truncation, returning a well-formed JSON payload ready for downstream parsing or schema validation.

## 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-4cf141d4/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)
