# 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 malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, fences) and validates the result so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: GET https://mesh.agentdiet.dev/v1/structured-output?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-0d2d562f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Xh7B2sOG5fbIWCLMARWZv

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-0d2d562f
```

Example prompt: The last LLM step returned this broken JSON with trailing commas and markdown fences — can you repair it into valid JSON so I can pass it to the next step: ```{"name": "Alice", "age": 30,}```?

## When to prefer this

Choose this endpoint when LLM-generated JSON is crashing downstream agents due to syntax errors like trailing commas, markdown code fences, single quotes, or truncation — especially in automated multi-agent pipelines where you cannot tolerate runtime JSON parse exceptions and need a deterministic (not generative) fix.

## Known failure modes

- Input JSON is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial object
- Input string is not JSON at all (e.g. plain prose) — may return error or empty object
- Truncated JSON missing critical structural context cannot be reliably closed — may produce incorrect schema
- Payment not processed (x402 402 response) — call fails before repair is attempted

## 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/structured-output)

## Output

A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready to be passed directly to downstream agents or parsers.

## 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-0d2d562f/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)
