# LLM JSON Repair & Schema Validator

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

Deterministically repairs malformed, truncated, or markdown-wrapped JSON from LLM outputs so multi-agent pipelines can safely consume structured data

## Facts

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

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 sec-intel-agentdiet-dev-llm-json-repair-schema-validator-7ae1a10d
```

Example prompt: This JSON came back from another LLM and it's broken — there are trailing commas, it's wrapped in markdown fences, and it got cut off near the end. Can you repair it so I can actually parse it? Here's the raw string: ```json {"name": "Alice", "score": 95, "tags": ["top", "performer",] ```

## When to prefer this

Choose this endpoint when LLM or agent outputs produce malformed JSON that crashes downstream parsers, especially in automated multi-agent pipelines where human intervention is not feasible. It is well-suited for fixing trailing commas, markdown wrapping, single-quote usage, and truncated structures in a deterministic (non-generative) way. Prefer it over writing custom regex-based fixers when you need a reliable, hosted repair step between LLM calls.

## Known failure modes

- Input is so corrupted that deterministic repair cannot infer the intended structure, returning an error
- Input contains no recoverable JSON structure at all
- Truncated JSON is ambiguous about intended completion and may be repaired incorrectly
- Payment via x402 fails or is rejected, blocking the request
- Very long malformed strings may hit query parameter length limits since input is passed via GET

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

## Output

Returns a repaired, valid JSON object with syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing and 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/sec-intel-agentdiet-dev-llm-json-repair-schema-validator-7ae1a10d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from sec-intel.agentdiet.dev](https://www.zero.xyz/host/sec-intel.agentdiet.dev/llms.txt)
