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

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

## Facts

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

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

Example prompt: The LLM returned this JSON but it won't parse — it has trailing commas and markdown code fences around it. Can you fix it so I can use it in the next step of my pipeline?

## When to prefer this

Use this endpoint when an LLM or agent in your pipeline emits JSON that fails standard JSON.parse due to common issues like trailing commas, markdown fences, or single quotes, and you need a deterministic (not AI-generated) fix that won't introduce hallucinated values. Prefer this over asking another LLM to fix the JSON, since this approach is deterministic, cheap, and won't alter the semantic content.

## Known failure modes

- Input is so severely malformed it cannot be deterministically repaired — returns error indicating unrecoverable JSON
- Empty or whitespace-only raw_json input — returns validation error
- Input is not JSON-like at all (e.g. plain prose) — may return error or best-effort partial result
- Payment failure via x402 — returns HTTP 402 before processing

## 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, valid JSON object that has been cleaned of issues such as trailing commas, markdown code fences, single quotes instead of double quotes, and truncation artifacts — ready to be parsed and used in downstream agent pipeline steps.

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