# 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 JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash

## Facts

- Endpoint: GET https://mesh.agentdiet.dev/v1/repair?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-31fb113a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-YoLGqtwLi_nrlGazfFln

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-31fb113a
```

Example prompt: The LLM just returned this broken JSON with trailing commas and markdown fences — can you clean it up so I can parse it: ```{"name": "Alice", "age": 30,}```?

## When to prefer this

Choose this endpoint when LLM or agent-generated JSON needs to be reliably parsed downstream and failures would break a multi-agent pipeline. Prefer it over manual regex patching when dealing with common LLM artifacts like trailing commas, markdown code fences, or single-quoted keys. Ideal for automated pipelines where JSON validity must be guaranteed before passing data to subsequent agents or tools.

## Known failure modes

- Input JSON is so heavily corrupted it cannot be deterministically repaired — ambiguous structure with no recovery path
- Input string is completely empty or not JSON-like at all
- Truncated JSON missing critical closing tokens that cannot be inferred
- Payment failure via x402 protocol if USDC balance is insufficient
- Rate limiting or network timeout if the endpoint is under load

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

## Output

A repaired, valid JSON object parsed from the originally malformed input, with issues like trailing commas, markdown code fences, single quotes, and truncation corrected deterministically. The response schema is a generic JSON object representing the fixed structure.

## 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-31fb113a/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)
