# CoCo JSON Fix — JSON Validation and Repair Tool

> CoCo JSON Fix — JSON Validation and Repair Tool is a paid API for AI agents from cocoeatsai.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Validates and repairs malformed JSON strings, returning the corrected JSON object and text along with a validity flag

## Facts

- Endpoint: GET https://cocoeatsai.com/area4/agent/tools/json-fix?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coco-json-fix-json-validation-and-repair-tool-47a5132f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1UZcByYtHOG6WYF9Gls6i

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 coco-json-fix-json-validation-and-repair-tool-47a5132f
```

Example prompt: I have a broken JSON string that won't parse — can you run it through the json-fix tool on CoCo to repair it and give me back valid, corrected JSON?

## When to prefer this

Choose this endpoint when you have a JSON string that fails to parse due to syntax errors (missing quotes, trailing commas, unescaped characters, etc.) and need it automatically repaired. Useful when working with LLM-generated JSON, user-provided JSON, or third-party API responses that are nearly-valid but syntactically broken. Prefer this over manual parsing logic when you need a quick, cheap automated repair step in a pipeline.

## Known failure modes

- Input JSON is so severely malformed that repair is impossible
- Non-JSON input provided (e.g. plain text, XML) that cannot be interpreted as JSON
- Empty input returns ambiguous or error response
- Network timeout for large JSON payloads

## How this service works

Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.

## Output

Returns a JSON object containing three fields: 'repaired' (the corrected JSON as a parsed object), 'repaired_text' (the corrected JSON as a formatted string), and 'was_valid_json' (a boolean indicating whether the original input was already valid JSON).

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "repaired": {
   "example": 1
  },
  "repaired_text": "{\"example\": 1}",
  "was_valid_json": true
 },
 "exampleNote": "Computed offline with demonstration inputs; time/random values are illustrative."
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coco-json-fix-json-validation-and-repair-tool-47a5132f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cocoeatsai.com](https://www.zero.xyz/host/cocoeatsai.com/llms.txt)
