# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from arxiv-digest.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://arxiv-digest.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: arxiv-digest.agentdiet.dev
- Website: https://arxiv-digest.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-3620e1ea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AeMwYwYt3fsVLDgHWsKB8

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 arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-3620e1ea
```

Example prompt: This JSON string came out of my LLM and it's broken — it has trailing commas, markdown fences, and single quotes instead of double quotes. Can you fix it so it parses correctly? Here's the raw output: ```json {name: 'Alice', age: 30, hobbies: ['reading', 'coding',]} ```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline is receiving malformed JSON that needs deterministic (not probabilistic) repair — especially for trailing commas, markdown fences, and single-quote issues common in LLM outputs. Prefer this over writing custom regex fixers or relying on LLM self-correction when you need consistent, repeatable JSON healing at low cost per call.

## Known failure modes

- Input JSON is so severely corrupted that deterministic repair is impossible, returning an error
- Input is not JSON-like at all (plain text, binary data), causing a validation rejection
- Ambiguous truncation with multiple valid completion candidates may produce unexpected structure
- Empty or whitespace-only raw_json input returns a validation error
- Network timeout or service unavailability returns HTTP 402/503

## 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://arxiv-digest.agentdiet.dev/v1/malformed-json-healer)

## Output

Returns a repaired JSON object where the previously malformed, truncated, or markdown-wrapped input has been deterministically fixed — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and any truncated structures closed — resulting in a valid, parseable JSON object.

## 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/arxiv-digest-agentdiet-dev-deterministic-a2a-broken-json-repair-3620e1ea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from arxiv-digest.agentdiet.dev](https://www.zero.xyz/host/arxiv-digest.agentdiet.dev/llms.txt)
