# 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-21).

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

## Facts

- Endpoint: GET 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-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-e9076942
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_W5YLMliQ2xIZYJPPJYEMl

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

Example prompt: Fix this malformed JSON from my LLM — it has trailing commas and markdown fences wrapping it: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse due to common LLM formatting errors — trailing commas, markdown fences, single quotes, or truncation. It is purpose-built for deterministic repair of AI output artifacts rather than general-purpose JSON linting. Prefer it over manual regex fixes or client-side libraries when you need a reliable, hosted, pay-per-call solution in an agentic workflow that must handle malformed outputs gracefully without crashing.

## Known failure modes

- Input is so severely truncated that meaningful repair is impossible — returns error or best-effort partial result
- Input contains non-JSON content entirely unrelated to JSON structure — may return error
- Extremely large malformed strings may hit query parameter size limits since raw_json is passed as a GET query parameter
- Ambiguous repair cases where multiple valid JSON interpretations exist may produce unexpected output

## 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, syntactically valid JSON object derived from the malformed input. The response contains the corrected JSON with issues like trailing commas, markdown code fences, single-quoted strings, and truncated structures resolved, making it safe to parse in downstream agent pipelines.

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