# Deterministic LLM JSON Repair & Schema Validator

> Deterministic LLM JSON Repair & Schema Validator is a paid API for AI agents from shopify-spy.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) into valid, parseable JSON for multi-agent pipelines

## Facts

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

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 shopify-spy-agentdiet-dev-deterministic-llm-json-repair-schema-8c23dcfa
```

Example prompt: My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so it's valid and parseable? Here it is: ```json {"name": "Alice", "age": 30, } ```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline frequently receives malformed JSON — especially outputs with trailing commas, single-quoted keys, or markdown code fences — that need deterministic, rule-based repair rather than probabilistic regeneration. Ideal when you cannot re-prompt the LLM, need sub-second repair latency, and want a lightweight fix step between agents in an automated workflow.

## Known failure modes

- JSON too severely truncated or corrupted to repair deterministically — returns error or best-effort partial result
- Input is not recognizable as JSON at all (e.g. plain prose) — repair may fail or return unexpected output
- Schema validation mismatch if the repaired JSON doesn't conform to an expected schema
- Empty or whitespace-only raw_json input — returns validation error
- Network timeout or upstream service unavailability — HTTP 5xx response
- Payment failure via x402 protocol — HTTP 402 response requiring USDC micropayment

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

## Output

A JSON object containing the repaired, valid JSON output. The malformed input is deterministically fixed — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — returning a parseable JSON structure ready for downstream agent consumption.

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