# 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-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://alpha-stream.agentdiet.dev/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-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-f9d056b7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uT85NnljvvbwE36j28Ot8

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

Example prompt: This JSON came back from the LLM and it's broken — it has trailing commas, markdown fences, and single quotes — can you repair it so it parses cleanly: ```{'name': 'Alice', 'score': 42,}```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated or model-produced JSON that fails to parse due to common LLM artifacts like trailing commas, markdown fences, single quotes, or truncation. It is deterministic (not probabilistic), making it reliable for production pipelines where consistency matters. Prefer it over prompt-retrying the LLM (which costs more and is slower) or writing custom regex repair logic.

## Known failure modes

- Input is so corrupted it cannot be deterministically repaired — returns an error indicating repair was not possible
- Input string is empty or whitespace — rejected by minLength:1 validation
- Ambiguous structure where multiple valid repairs are possible — may return best-effort result or error
- Network or payment (x402) authentication failure — 402 Payment Required if micropayment not included

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

## Output

A JSON object containing the repaired, valid JSON structure derived from the malformed input, suitable for immediate use in downstream agent steps or pipelines.

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