# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from mcp-compiler.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://mcp-compiler.agentdiet.dev/v1/json-fix?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: mcp-compiler.agentdiet.dev
- Website: https://mcp-compiler.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-38617079
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xs_YeQHRqK_frOUzyJY5f

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 mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-38617079
```

Example prompt: This LLM output came back as broken JSON with trailing commas and markdown fences — can you fix it so I can parse it? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when an LLM or agent has produced malformed JSON that needs deterministic, rule-based repair before being parsed downstream — especially when dealing with trailing commas, markdown fences, or single-quoted keys. Prefer this over writing custom regex sanitizers or relying on LLM self-correction, which is non-deterministic. Best suited for multi-agent pipelines where JSON parsing failures are a recurring failure mode.

## Known failure modes

- Input JSON too severely corrupted to deterministically repair — returns error indicating unparseable input
- Empty or whitespace-only raw_json input — returns validation error for missing required field
- Input that is not JSON-like at all (plain text, binary) — may return error or best-effort result
- Payment required (HTTP 402) if x402 USDC micropayment is not included

## 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://mcp-compiler.agentdiet.dev/v1/json-fix)

## Output

A JSON object containing the repaired, valid JSON string reconstructed from the malformed input, with common issues like trailing commas, markdown code fences, single quotes, and truncation resolved deterministically.

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