# Deterministic LLM JSON Repair & Schema Validator

> Deterministic LLM 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-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can parse outputs without crashing.

## Facts

- Endpoint: GET https://alpha-stream.agentdiet.dev/v1/llm-json-schema-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-llm-json-repair-schema-463fe891
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uBmWsa3teRCAMp008TJVk

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-llm-json-repair-schema-463fe891
```

Example prompt: The JSON that came back from the last LLM call is broken — it has trailing commas and markdown fences wrapping it. Can you send it through the JSON healer and give me the clean, parseable version?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() — especially outputs with trailing commas, markdown code fences, single-quoted keys/values, or truncated structures. Prefer it over generic retry logic when deterministic, non-stochastic repair is needed to keep pipelines stable.

## Known failure modes

- Input JSON is so severely malformed it cannot be deterministically repaired — returns error with partial repair attempt
- Input is not JSON at all (plain text, binary) — returns validation error
- Ambiguous truncation where multiple valid completions exist — may return best-guess repair
- Empty raw_json string — returns schema validation error

## 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/llm-json-schema-healer)

## Output

Returns a JSON object containing the repaired, valid JSON reconstructed from the malformed input — with trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for downstream parsing.

## 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-llm-json-repair-schema-463fe891/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)
