# 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, markdown fences) into valid JSON for use in multi-agent pipelines

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/v1/schema-repair?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-ef51894f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Acg-ZzKqP79o2WyuiuIDo

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

Example prompt: This LLM output came back with markdown fences and trailing commas and it's crashing my pipeline — can you repair it into valid JSON: ```{"name": "Alice", "score": 42,}```?

## When to prefer this

Choose this endpoint when a multi-agent pipeline receives malformed, truncated, or markdown-wrapped JSON from an LLM and needs a fast, deterministic (non-AI) repair before downstream processing. Ideal when you need reliable, rule-based fixes (trailing commas, single quotes, fences) rather than probabilistic regeneration. Prefer over prompt-retrying the LLM when latency and cost matter.

## Known failure modes

- Input is so severely malformed that deterministic repair is ambiguous or impossible, returning an error
- Input string is empty (violates minLength:1 constraint)
- JSON is semantically invalid in ways that cannot be inferred (e.g. missing required values with no context)
- Payment not processed (x402 402 response) if USDC micropayment fails
- Timeout if input is extremely large

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

## Output

A repaired, valid JSON object derived from the malformed input string, with syntax errors corrected — trailing commas removed, single quotes converted to double quotes, markdown fences stripped, and truncated structures closed — ready for downstream parsing and processing.

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