# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) to prevent multi-agent pipeline crashes

## Facts

- Endpoint: GET https://mesh.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: mesh.agentdiet.dev
- Website: https://mesh.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-4a2b8437
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qcs_uex89fV94izpPBU2n

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 mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-4a2b8437
```

Example prompt: This JSON from the LLM response is broken — it has trailing commas and markdown code fences wrapping it — can you repair it into valid JSON? Here it is: ```json {"name": "Alice", "score": 42, } ```

## When to prefer this

Choose this endpoint when an AI agent or LLM pipeline produces JSON that fails to parse due to common LLM formatting errors like trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (not a generative re-write), making it safe and predictable for production pipelines. Prefer it over prompt-engineering retries when latency and token cost matter, or when the source model is not accessible for a follow-up call.

## Known failure modes

- Input is so severely malformed that deterministic repair cannot reconstruct intent — returns error or best-effort partial repair
- Input is not JSON at all (e.g. plain prose) — endpoint may return error or unexpected output
- Very long truncated JSON where closing structure is ambiguous — reconstruction may not match original intent
- Payment/402 flow fails if USDC funds are insufficient or x402 protocol is misconfigured

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

## Output

Returns a repaired, syntactically valid JSON object. The malformed input string is deterministically corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — yielding a parseable JSON payload safe for downstream agent or pipeline consumption.

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