# 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 malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, fence blocks) so agent pipelines can safely parse them

## Facts

- Endpoint: GET https://mcp-compiler.agentdiet.dev/v1/repair?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-987bc021
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HwfJTz8fJ73csrjSQul2v

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-987bc021
```

Example prompt: The LLM just returned this JSON with trailing commas and markdown fences and it's crashing my parser — can you clean it up and give me valid JSON back: ```json {"name": "Alice", "score": 42, } ```

## When to prefer this

Choose this endpoint when your agent pipeline receives JSON from an LLM that frequently produces syntax errors such as trailing commas, markdown-wrapped output, single-quoted strings, or truncated responses, and you need a deterministic (not probabilistic) fix before passing data downstream. Ideal for hardening multi-agent pipelines against parse failures without adding another LLM call.

## Known failure modes

- Input JSON is so severely malformed or incomplete that deterministic repair is impossible
- Input is not JSON at all (e.g. plain prose), causing repair to fail or produce garbage output
- Ambiguous truncation points where multiple valid completions exist, potentially producing incorrect structure
- Very large JSON strings may hit query parameter length limits since raw_json is passed as a query parameter
- Payment failure (HTTP 402) if x402 USDC payment is not properly attached

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

## Output

A repaired, valid JSON object that has had common LLM-generated syntax errors corrected, including removal of markdown fences, fixing trailing commas, converting single quotes to double quotes, and closing truncated structures — ready to be deserialized by any standard JSON parser.

## 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-987bc021/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)
