# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from alpha-stream.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://alpha-stream.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: alpha-stream.agentdiet.dev
- Website: https://alpha-stream.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-e41d6f6e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PkkGr2tmpn75s_bmgth-I

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 alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-e41d6f6e
```

Example prompt: This JSON string from my LLM is broken — it has trailing commas, markdown fences, and single quotes — can you repair it into valid JSON? Here it is: ```{name: 'Alice', age: 30,}```

## When to prefer this

Use this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common issues like trailing commas, markdown code fences, single quotes, or truncation. Prefer this over manual regex fixes or custom parsers when you need a deterministic, hosted repair service that integrates natively with x402 micropayment flows and MCP-compatible agent orchestration.

## Known failure modes

- Input JSON is so severely truncated that repair is ambiguous or impossible
- Malformation is beyond deterministic repair heuristics (e.g. completely scrambled structure)
- Empty or whitespace-only raw_json input
- Input exceeds size limits
- Payment not processed (HTTP 402) if x402 credentials are missing or invalid

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

## Output

A JSON object containing the repaired, valid JSON structure derived from the malformed input. The response should be parseable and schema-compliant after correction of issues like trailing commas, markdown fences, single quotes, and truncation artifacts.

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