JSON Repair
Fix broken JSON: trailing commas, single quotes, unquoted keys, comments, truncation and stray Markdown. Returns valid JSON.
Free to try Pay by wallet (x402)
json-repair Example
Input
{
"json": "{\"name\": \"Test\", \"value\": 42}"
} Answer
{
"json": "{\n \"name\": \"Test\",\n \"value\": 42\n}",
"valid": true,
"parsed": {
"name": "Test",
"value": 42
},
"fixes_applied": []
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
json | string | Yes | Broken JSON string to repair |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
json | string | Always (present in every successful answer) |
valid | boolean | Always (present in every successful answer) |
parsed | object | Always (present in every successful answer) |
fixes_applied | array | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Free tool: works without a key, within a monthly allowance. Add your key for more.
curl -X POST https://api.strale.io/v1/do \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "json-repair",
"inputs": {
"json": "{\"name\": \"Test\", \"value\": 42}"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "json-repair",
"inputs": {
"json": "{\"name\": \"Test\", \"value\": 42}"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "json-repair",
inputs: {
"json": "{\"name\": \"Test\", \"value\": 42}"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="json-repair",
inputs={
"json": "{\"name\": \"Test\", \"value\": 42}",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/json-repair?json=%7B%22name%22%3A+%22Test%22%2C+%22value%22%3A+42%7D' Limitations
Severely malformed JSON may not be recoverable
Repairs common JSON errors (trailing commas, unquoted keys, single quotes) — severely malformed input may not be recoverable
What to do instead: If repair fails, extract valid JSON segments manually and reconstruct the intended structure.
Related tools
- Address Parser €0.05
- Company Industry Classification €0.05
- Company Name Match €0.02
- Credit Score Band €0.02
- CSV Cleaner €0.02
- CSV to JSON €0.02