# Deterministic LLM JSON Repair & Schema Validator

> Deterministic LLM JSON Repair & Schema Validator is a paid API for AI agents from json-repair.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-10-21).

Repairs malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, unclosed braces) so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: GET https://json-repair.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: json-repair.agentdiet.dev
- Website: https://json-repair.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/json-repair-agentdiet-dev-deterministic-llm-json-repair-schema-74869f8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qe_uFkTPZIdj0UABboJ0H

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 json-repair-agentdiet-dev-deterministic-llm-json-repair-schema-74869f8c
```

Example prompt: This JSON string came back from an LLM with trailing commas, unclosed brackets, and markdown fences around it — can you repair it so it's valid JSON I can parse? Here it is: ```json {"name": "Alice", "score": 42, "tags": ["ai", "agent",] ```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails to parse due to common LLM output artifacts (trailing commas, markdown code fences, single quotes, truncation, unclosed brackets). Prefer it over general-purpose JSON linters when you need deterministic, automated repair — not just validation — especially in agentic workflows where crashing on bad JSON is unacceptable. It is particularly well-suited for pipelines that need a lightweight, pay-per-call repair step without standing up their own JSON sanitization service.

## Known failure modes

- Input JSON too severely corrupted to deterministically infer structure — returns error or best-effort partial repair
- Empty or non-JSON input string — may return error indicating no repairable content found
- Very large JSON strings may hit query parameter size limits since raw_json is passed as a GET query parameter
- Network timeout on slow connections
- Payment failure via x402 if USDC balance insufficient

## 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://json-repair.agentdiet.dev/v1/llm-json-schema-healer)

## Output

A repaired, syntactically valid JSON object corrected from the malformed input — with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, truncated structures closed, and all standard JSON syntax errors fixed. The response is a JSON object containing the healed JSON.

## 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/json-repair-agentdiet-dev-deterministic-llm-json-repair-schema-74869f8c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from json-repair.agentdiet.dev](https://www.zero.xyz/host/json-repair.agentdiet.dev/llms.txt)
