# 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) deterministically so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: POST https://mesh.agentdiet.dev/v1/llm-json-schema-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-cbb100da
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VI25hooDrulZIgau1hUnn

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

Example prompt: The JSON my LLM just returned is broken — it has trailing commas, single quotes instead of double quotes, and a markdown code fence wrapper. Can you repair it so I can use it downstream? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated pipelines — especially when you cannot afford hallucinated or AI-guessed corrections. Prefer this over ad-hoc regex fixes or asking the LLM to re-generate when you need reliability, auditability, and speed. Ideal for multi-agent orchestration layers where downstream tools expect strict JSON and LLM outputs frequently include markdown fences, trailing commas, or single quotes. Not a replacement for schema-aware generation up front, but the best safety net after the fact.

## Known failure modes

- Input JSON is so corrupted that deterministic repair is impossible — returns error indicating unrecoverable structure
- Input string is empty or missing the required raw_json field — returns 400 validation error
- JSON is actually valid but schema validation against a provided schema fails — returns schema mismatch error
- Network or payment failure (HTTP 402 if payment not provided) — call fails 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/llm-json-schema-healer)

## Output

Returns a repaired, schema-compliant JSON object derived from the input malformed string. The response includes the fixed JSON structure with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed. The agent receives a valid, parseable JSON object ready for downstream 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-cbb100da/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)
