# JSON Repair Service

> JSON Repair Service is a paid API for AI agents from toolbelt402.tpoborne.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Fixes invalid, malformed, or truncated JSON strings and returns both the parsed object and the corrected JSON text, deterministically without an LLM.

## Facts

- Endpoint: POST https://toolbelt402.tpoborne.workers.dev/json/repair
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-repair-service-06616808
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MP820QUH8WX7THzyYW6G5

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 json-repair-service-06616808 -d '<json body>'
```

Example prompt: This JSON string from an LLM response got cut off and has trailing commas and single quotes — can you repair it and give me back the fixed JSON text and parsed object? Here it is: {'name': 'Alice', 'age': 30, 'hobbies': ['reading', 'coding',}

## When to prefer this

Choose this endpoint when you have syntactically broken JSON — from LLM output, legacy systems, or manual editing — that needs deterministic, rule-based repair without invoking another LLM. Prefer it over LLM-based JSON fixing when you need reproducibility, low cost, and fast turnaround. It specifically excels at trailing commas, single-quoted strings, unquoted keys, and truncated output — common failure modes from generative AI pipelines.

## Known failure modes

- Input is so corrupted it cannot be salvaged into valid JSON — returns an error indicating repair failure
- Input is not JSON-like at all (e.g. plain prose) — repair cannot proceed
- Extremely large JSON strings may hit payload size limits
- Network or worker timeout for unusually complex repair jobs

## How this service works

Fix invalid, malformed, or truncated JSON — repairs trailing commas, single quotes, unquoted keys, and cut-off LLM output; returns the parsed object plus corrected JSON text. Deterministic, no LLM.

## Output

Returns the successfully parsed JavaScript/JSON object along with the corrected, valid JSON string. If repair is possible, both the structured object and the fixed text are provided so the caller can use either form downstream.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Possibly-broken JSON as a string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-repair-service-06616808/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
