# LLM JSON Repair & Schema Validator

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

Deterministically repairs malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can safely consume them.

## Facts

- Endpoint: GET https://company-enrich.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: company-enrich.agentdiet.dev
- Website: https://company-enrich.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/company-enrich-agentdiet-dev-llm-json-repair-schema-validator-8f67286f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VPv7Mr8iul52U9Zvh5h05

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 company-enrich-agentdiet-dev-llm-json-repair-schema-validator-8f67286f
```

Example prompt: My LLM just returned this JSON with trailing commas and markdown code fences — can you deterministically repair it so I can parse it cleanly: ```json {"name": "Acme", "score": 42,} ```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline or LLM workflow is receiving JSON outputs that are syntactically broken due to common LLM failure modes (trailing commas, markdown wrapping, single quotes, truncation) and you need a fast, deterministic fix before downstream parsing. Prefer this over a general-purpose JSON library when the errors are specifically LLM-output patterns and you need a hosted, pay-per-call solution compatible with x402/MCP agent architectures.

## Known failure modes

- Input JSON too severely corrupted to deterministically repair — returns error indicating repair not possible
- Empty or whitespace-only raw_json input — validation error
- Input exceeds maximum length limits — truncation or rejection error
- Ambiguous structure where multiple valid repairs exist — may return one interpretation without warning

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

## Output

Returns a repaired, valid JSON object where the input malformed, truncated, or markdown-wrapped JSON string has been deterministically fixed — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and missing closing brackets/braces added as needed.

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