# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from mcp-security.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-11-21).

Repairs malformed, truncated, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines can process them without crashing.

## Facts

- Endpoint: POST https://mcp-security.agentdiet.dev/v1/structured-output?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Provider: mcp-security.agentdiet.dev
- Website: https://mcp-security.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mcp-security-agentdiet-dev-deterministic-a2a-broken-json-repair-8ee6bd2b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MrT_ru1RG8sZaUOp6Tte2

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-security-agentdiet-dev-deterministic-a2a-broken-json-repair-8ee6bd2b -d '<json body>'
```

Example prompt: This JSON from the LLM response is broken — it has trailing commas, single quotes, and a markdown code fence. Can you repair it so it's valid JSON I can actually parse: ```{'name': 'Alice', 'age': 30,}```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives JSON from LLMs that frequently produces malformed output (trailing commas, markdown wrapping, single quotes, truncation). It is purpose-built for the LLM-to-agent handoff problem and applies deterministic repair rules, making it predictable and safe for automated pipelines. Prefer it over custom regex hacks or general-purpose JSON parsers when you need reliable, consistent repair with an auditable per-call cost model.

## Known failure modes

- Input JSON is too severely corrupted to deterministically repair — returns error or best-effort partial result
- Input string is not JSON at all (e.g. plain prose) — may return error
- Ambiguous repair paths where multiple valid interpretations exist — one is chosen deterministically but may not match intent
- Empty or whitespace-only input — 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://mcp-security.agentdiet.dev/v1/structured-output)

## Output

A repaired, valid JSON object that has been cleaned of common LLM output artifacts including trailing commas, markdown code fences, single-quoted strings, and truncation issues — ready for immediate downstream consumption by agents or parsers.

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