# 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-10-23).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.

## Facts

- Endpoint: POST https://mcp-security.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-23
- 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-dd922c6a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5ofCl7kflS56H8RaTbd1N

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-dd922c6a -d '<json body>'
```

Example prompt: This JSON came back from the LLM but it has trailing commas and is wrapped in markdown code fences — can you fix it so it's valid and parseable? Here it is: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair in a multi-agent or LLM pipeline where malformed outputs from language models (trailing commas, markdown wrapping, single quotes, truncation) are causing downstream crashes. Prefer it over manual string processing or regex hacks when reliability and idempotency across retries matter. Especially useful in automated workflows where human intervention is not feasible.

## Known failure modes

- Input JSON is too severely corrupted to deterministically repair — returns error with description
- Input is not JSON-like at all (plain text, HTML) — cannot infer structure
- Ambiguous truncation with multiple valid completions — may return best-guess with confidence flag
- 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/malformed-json-healer)

## Output

A repaired, valid JSON object that has been cleaned of common LLM output issues including trailing commas, markdown fences, single quotes, and truncation artifacts — ready for downstream parsing and schema validation.

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