# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from x402-audit.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://x402-audit.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: x402-audit.agentdiet.dev
- Website: https://x402-audit.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1c6c6790
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Sfo585ZP_BDWID3AXX4zu

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 x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1c6c6790
```

Example prompt: This LLM response came back as broken JSON with trailing commas and markdown fences — can you run it through the malformed-json-healer to fix it so my pipeline doesn't crash? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may contain trailing commas, markdown fences, single quotes, or truncation artifacts and you need a deterministic (not LLM-based) fix rather than asking another LLM to reformat it. Prefer this over manual regex hacks or prompting the LLM again when reliability and idempotency across thousands of pipeline calls matter.

## Known failure modes

- JSON too severely malformed to deterministically repair (ambiguous structure)
- Empty or null raw_json input
- Payload exceeds length limits
- Non-JSON content passed as input (e.g. plain text or XML)
- Network or payment (x402) authorization failure

## 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://x402-audit.agentdiet.dev/v1/malformed-json-healer)

## Output

A repaired, valid JSON object that has been cleaned of common LLM-introduced errors such as trailing commas, markdown code fences, single quotes, and truncation artifacts — ready for downstream parsing without crashes.

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