# Deterministic JSON Repair & Schema Validator

> Deterministic 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 malformed, truncated, or improperly formatted LLM JSON outputs (trailing commas, markdown fences, single quotes) to prevent multi-agent pipeline crashes

## Facts

- Endpoint: GET https://hn-pulse.agentdiet.dev/v1/json-fix?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-json-repair-schema-validator-b6417613
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FnjPeR2pOn4QPu5jNtKSm

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-json-repair-schema-validator-b6417613
```

Example prompt: This JSON output from the last LLM call is broken — it has trailing commas and markdown code fences wrapping it. Can you fix it so I can parse it? Here it is: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives JSON from an LLM that fails to parse due to common formatting errors like trailing commas, markdown code fences, single quotes instead of double quotes, or truncation. It is purpose-built for deterministic (non-AI, rule-based) JSON repair, making it reliable and predictable compared to asking another LLM to fix the JSON. Best suited for automated pipelines where consistent, fast correction is needed at $0.002 per call.

## Known failure modes

- JSON too severely truncated or corrupted to recover — returns error or best-effort partial result
- Input that is not JSON-like at all — no recognizable structure to repair
- Network timeout or service unavailability returning HTTP 5xx
- Payment failure via x402 protocol returning HTTP 402 if USDC balance insufficient
- Ambiguous repair cases where multiple valid interpretations exist — may return one without indication of ambiguity

## 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/json-fix)

## Output

A JSON object containing the repaired, valid JSON structure derived from the malformed input, suitable for immediate programmatic use without further sanitization

## 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-json-repair-schema-validator-b6417613/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)
