Repair broken JSON from LLM output and validate it against a JSON Schema.
Maintain this server? Claim it
Call this server's tools from your browser. Nothing to install.
Optional. 'Bearer <key>' (free jm_ key) for higher limits. Works without a key.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Turn broken or messy JSON text into valid JSON. Strips Markdown code fences and prose before/after the JSON, removes comments and trailing commas, converts single/curly quotes, quotes unquoted keys, maps Python None/True/False, inserts missing commas, closes truncated strings/arrays/objects, and wraps NDJSON / several concatenated objects into one array. Returns the parsed value (json), the repaired text, and the list of fixes applied; valid input passes through unchanged with no fixes. Optional schema (+ coerce) also validates the result. Fails with isError (code unrepairable / no_json_found) when nothing JSON-like can be recovered. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/repair.
The raw (possibly broken) JSON text, e.g. an LLM reply with code fences and prose around the JSON. Max 102,400 bytes (UTF-8).
JSON Schema draft. Default: from the schema's $schema, else 2020-12.
Convert values toward the schema's declared types before validating: "42" → 42, "true" → true, "null" → null, 5 → "5", x → [x]. Each change is listed in coercions.
Layout of the returned text: compact (default), pretty (2-space indent), or preserve (jsonrepair's output, keeps original spacing and long-number digits).
A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB.
Turn broken or messy JSON text into valid JSON. Strips Markdown code fences and prose before/after the JSON, removes comments and trailing commas, converts single/curly quotes, quotes unquoted keys, maps Python None/True/False, inserts missing commas, closes truncated strings/arrays/objects, and wraps NDJSON / several concatenated objects into one array. Returns the parsed value (json), the repaired text, and the list of fixes applied; valid input passes through unchanged with no fixes. Optional schema (+ coerce) also validates the result. Fails with isError (code unrepairable / no_json_found) when nothing JSON-like can be recovered. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/repair.
| Argument | Type | Description |
|---|---|---|
| draft | string | JSON Schema draft. Default: from the schema's $schema, else 2020-12. |
| input* | string | The raw (possibly broken) JSON text, e.g. an LLM reply with code fences and prose around the JSON. Max 102,400 bytes (UTF-8). |
| coerce | boolean | Convert values toward the schema's declared types before validating: "42" → 42, "true" → true, "null" → null, 5 → "5", x → [x]. Each change is listed in coercions. |
| format | string | Layout of the returned text: compact (default), pretty (2-space indent), or preserve (jsonrepair's output, keeps original spacing and long-number digits). |
| schema | object | A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB. |
{
"type": "object",
"required": [
"input"
],
"properties": {
"draft": {
"enum": [
"2020-12",
"2019-09",
"7",
"4"
],
"type": "string",
"description": "JSON Schema draft. Default: from the schema's $schema, else 2020-12."
},
"input": {
"type": "string",
"maxLength": 102400,
"minLength": 1,
"description": "The raw (possibly broken) JSON text, e.g. an LLM reply with code fences and prose around the JSON. Max 102,400 bytes (UTF-8)."
},
"coerce": {
"type": "boolean",
"default": false,
"description": "Convert values toward the schema's declared types before validating: \"42\" → 42, \"true\" → true, \"null\" → null, 5 → \"5\", x → [x]. Each change is listed in coercions."
},
"format": {
"enum": [
"compact",
"pretty",
"preserve"
],
"type": "string",
"default": "compact",
"description": "Layout of the returned text: compact (default), pretty (2-space indent), or preserve (jsonrepair's output, keeps original spacing and long-number digits)."
},
"schema": {
"type": "object",
"description": "A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB."
}
},
"additionalProperties": false
}Check JSON against a JSON Schema and get every error with its JSON Pointer path. Send the JSON either as text ("input"; broken text is repaired first, and the fixes are listed) or as an already-parsed value ("data"). Optional coerce converts "42" → 42, "true" → true, etc. toward the schema's types before validating and lists each change. A schema mismatch is a normal result (valid: false), not an error. Drafts 2020-12 (default), 2019-09, 7, 4; only local $refs. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/validate.
| Argument | Type | Description |
|---|---|---|
| data | any | An already-parsed JSON value to validate. Send this or "input", not both. |
| draft | string | JSON Schema draft. Default: from the schema's $schema, else 2020-12. |
| input | string | JSON text to validate (repaired first if broken). Send this or "data", not both. Max 102,400 bytes. |
| coerce | boolean | Convert values toward the schema's declared types before validating: "42" → 42, "true" → true, "null" → null, 5 → "5", x → [x]. Each change is listed in coercions. |
| schema* | object | A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB. |
{
"type": "object",
"required": [
"schema"
],
"properties": {
"data": {
"description": "An already-parsed JSON value to validate. Send this or \"input\", not both."
},
"draft": {
"enum": [
"2020-12",
"2019-09",
"7",
"4"
],
"type": "string",
"description": "JSON Schema draft. Default: from the schema's $schema, else 2020-12."
},
"input": {
"type": "string",
"maxLength": 102400,
"minLength": 1,
"description": "JSON text to validate (repaired first if broken). Send this or \"data\", not both. Max 102,400 bytes."
},
"coerce": {
"type": "boolean",
"default": false,
"description": "Convert values toward the schema's declared types before validating: \"42\" → 42, \"true\" → true, \"null\" → null, 5 → \"5\", x → [x]. Each change is listed in coercions."
},
"schema": {
"type": "object",
"description": "A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB."
}
},
"additionalProperties": false
}