# 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/json-fix?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-b0f91325
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BBxMTCoSahs3Qn8opeuYl

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-b0f91325
```

Example prompt: This JSON came back from the LLM and it's broken — it has trailing commas, single quotes, and a markdown code fence wrapping it. Can you run it through the JSON repair service and give me back valid, parseable JSON? Here's the raw string: ```json {'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline or LLM workflow produces JSON that fails standard parsing due to common LLM output artifacts like trailing commas, markdown code fences, or single quotes. It is especially suited for deterministic, reproducible repair (no AI hallucination in the fix) and integrates natively with x402 micropayment and MCP/A2A protocols.

## Known failure modes

- JSON is so severely malformed it cannot be deterministically repaired — returns error
- Input string is empty or not JSON-like at all — returns validation error
- Truncation is too deep to infer closing structure — may return partial repair with warning
- Rate limiting or payment failure via x402 — returns 402 Payment Required

## 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/json-fix)

## Output

Returns a JSON object containing the repaired, valid JSON — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without errors.

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