# 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/repair?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-1ac4feeb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sZCBOlIXBw0ULlFXzcXQ-

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

Example prompt: The LLM response I got back has broken JSON — it has trailing commas, single quotes instead of double quotes, and a markdown code fence wrapper. Can you fix it so it parses cleanly? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsing — especially when outputs contain markdown fences, trailing commas, single quotes, or truncation artifacts. Prefer this over manual regex hacks or custom parsers when you need deterministic, reliable repair across all common LLM JSON failure modes. Ideal for production agentic workflows where downstream steps require valid JSON and crashes must be avoided.

## Known failure modes

- JSON is too severely corrupted or ambiguous to deterministically repair — returns error indicating unrecoverable input
- Input string is empty or whitespace — fails minLength validation
- JSON structure is so truncated that intent cannot be inferred — may return partial or error response
- Payment required error (HTTP 402) if x402 payment not provided
- Network timeout if service is temporarily unavailable

## 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

Returns a repaired, valid JSON object that has been cleaned of common LLM output artifacts including trailing commas, markdown code fences, single quotes, and truncation issues — ready for standard JSON parsing in downstream 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-1ac4feeb/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)
