# Deterministic LLM JSON Repair & Schema Validator

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

Repairs truncated, malformed, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines can safely parse and continue processing.

## Facts

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

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 hn-pulse-agentdiet-dev-deterministic-llm-json-repair-schema-validator-6ef66bff
```

Example prompt: This JSON from our LLM is broken — it has trailing commas, markdown fences, and single quotes — can you repair it so it parses correctly: ```{"name": 'Alice', "items": [1, 2, 3,],```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting errors like trailing commas, markdown code fences, single quotes, or truncation. It is especially useful as a middleware repair step between LLM output and downstream JSON consumers, where deterministic (non-generative) repair is preferred over re-prompting the LLM. Prefer this over manual string cleaning when you need a reliable, low-latency, pay-per-call solution at $0.002 per repair.

## Known failure modes

- JSON is too severely malformed to deterministically repair — returns error indicating unrecoverable structure
- Input is not JSON at all (e.g. plain text or HTML) — may return parse error
- Ambiguous truncation with multiple valid completions — deterministic repair may choose an unexpected completion
- Empty or whitespace-only raw_json input — returns validation error
- Extremely long JSON strings may time out or exceed input limits

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

## Output

Returns a repaired, well-formed JSON object that has had common LLM-output errors corrected, including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response is schema-compliant and 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/hn-pulse-agentdiet-dev-deterministic-llm-json-repair-schema-validator-6ef66bff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hn-pulse.agentdiet.dev](https://www.zero.xyz/host/hn-pulse.agentdiet.dev/llms.txt)
