# 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, malformed, or markdown-wrapped LLM JSON outputs so multi-agent pipelines can continue without crashing.

## Facts

- Endpoint: GET https://mcp-compiler.agentdiet.dev/v1/structured-output?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-bf8815bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_W1b0mJ-QgHQVYaKlT2VPa

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

Example prompt: My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it and give me a valid JSON object I can actually parse? Here's the raw output: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when you need a deterministic, rule-based JSON repair rather than an LLM-based reformatter — ideal for production multi-agent pipelines where consistency and predictability matter. Best when the malformation is structural (trailing commas, markdown wrappers, single quotes, truncation) rather than semantic corruption. Prefer this over ad-hoc prompt engineering to fix JSON, as it guarantees a uniform repair strategy without consuming additional LLM tokens.

## Known failure modes

- JSON is too severely malformed to repair deterministically — returns an error or best-effort partial object
- Input string is not JSON-like at all — may return an error indicating unparseable input
- Truncated JSON where the missing content cannot be inferred — may return incomplete repaired object
- Network or payment failure — HTTP 402 if payment credentials are missing or invalid

## 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/structured-output)

## Output

A repaired, valid JSON object that has been sanitized of common LLM formatting issues including trailing commas, markdown fences, single quotes, and truncation artifacts — 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/mcp-compiler-agentdiet-dev-deterministic-a2a-broken-json-repair-bf8815bf/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)
