# AgentKit JSON Repair

> AgentKit JSON Repair is a paid API for AI agents from api.firstmention.uk, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-19).

Repairs malformed JSON strings by fixing common syntax errors such as unquoted keys and trailing commas, returning the corrected parsed value

## Facts

- Endpoint: POST https://api.firstmention.uk/s/agentkit/repair?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentkit-json-repair-eaef37a8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J-Psw9RDwE6U-a-S0HGem

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 agentkit-json-repair-eaef37a8 -d '<json body>'
```

Example prompt: Can you fix this broken JSON for me? It has unquoted keys and trailing commas: `{a: 1, b: [1,2,3,], c: null,}`

## When to prefer this

Use this endpoint when you have a JSON string with common, recoverable syntax errors like unquoted object keys or trailing commas — typical output from LLMs, hand-written configs, or loosely-parsed web scrapes. Prefer this over a full JSON validator when you want auto-correction rather than just error reporting, and when you need the repaired parsed value back immediately in a single call.

## Known failure modes

- Input JSON is so severely malformed it cannot be repaired — returns ok:false or error
- Input is not a string — schema mismatch error
- Empty or null input — may return error or unchanged result
- JSON with structural issues beyond trailing commas and unquoted keys may not be fully repaired
- Payment failure via x402 — 402 response with payment instructions

## How this service works

Pay-per-call HTTP APIs, paid with x402 in USDC on Base (eip155:8453): agentkit, api-change-check, basedue, bizcal-api, chainread, check-sanctions, chgwatch, company-facts, domain-intel, domainkit, domfacts, due, edgar, funding-rates, fundinglens, pageaudit, solcheck, token-dd, txpreflight, walletprofile, web-extract, webmd, webread, websearch, x402-preflight, x402check, x402index. Each operation describes its service.

## Output

Returns a JSON object with: 'ok' (boolean success), 'fixes' (array of human-readable descriptions of what was corrected, e.g. 'quoted unquoted object key(s)', 'removed trailing comma(s)'), 'value' (the fully parsed and corrected JSON value), and 'changed' (boolean indicating whether any repairs were made).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string"
  },
  "budget": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "repaired": "{\"a\": 1, \"b\": [1,2,3], \"c\": null}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentkit-json-repair-eaef37a8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.firstmention.uk](https://www.zero.xyz/host/api.firstmention.uk/llms.txt)
