# AgentsToolsHub JSON Repair

> AgentsToolsHub JSON Repair is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-17).

Repairs broken or malformed JSON by fixing trailing commas, single quotes, unquoted keys, Python literals, NaN, comments, smart quotes, and truncated documents

## Facts

- Endpoint: GET https://agentstoolshub.com/api/v1/dev/json-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstoolshub-json-repair-846bfd02
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WbNkZ5xHObcpoKSCo37tH

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 agentstoolshub-json-repair-846bfd02
```

Example prompt: This JSON from the LLM response has trailing commas and single quotes and won't parse — can you fix it? Here it is: {'name': 'Alice', 'age': 30, 'active': True,}

## When to prefer this

Use this endpoint whenever an LLM, human, or upstream service produces JSON that fails standard parsing due to common syntax mistakes. It specifically handles the most frequent agentic failure modes — LLM outputs with Python-style literals, trailing commas, single quotes, and truncated responses — making it the right choice before retrying a JSON.parse() call or before passing LLM output to a downstream system.

## Known failure modes

- Input is so severely malformed it cannot be meaningfully repaired — returns an error or empty result
- Input is not JSON-like at all (e.g. plain text or binary) — repair may fail or return unexpected output
- Truncated JSON with ambiguous structure may be completed in an unintended way
- Missing required 'text' query parameter returns a validation error

## How this service works

Repairs broken JSON: trailing commas, single quotes, unquoted keys, Python literals (True/False/None), NaN, comments, smart quotes and truncated documents. Built for the most common agentic failure mode — parsing slightly-wrong JSON from an LLM or a human. Use this when an agent needs to fix LLM-mangled, truncated or sloppy JSON.

## Output

A valid, parseable JSON object with all syntax errors corrected — trailing commas removed, single quotes replaced with double quotes, unquoted keys quoted, Python literals (True/False/None) converted to JSON equivalents, NaN handled, comments stripped, smart quotes normalized, and truncated documents completed or closed as best as possible.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Broken JSON"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstoolshub-json-repair-846bfd02/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
