json-extract
Extracts and parses JSON from mixed-content text, handling code fences, trailing commas, and JSON5 syntax. Returns cleaned JSON and repair details.
Instructions
Extracts and parses JSON from mixed-content text. Handles LLM output with JSON embedded in prose, code fences (```json), trailing commas, single-quoted strings, JS-style comments, and bare object keys (JSON5-style). Returns the parsed data, a cleaned JSON string, extraction method used, and any repair applied. Pure text processing — zero external API calls.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "json-extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text containing JSON, possibly mixed with prose or code fences. Max 200,000 chars. | |
| schema_check | No | Optional: JSON Schema (draft-07 subset) to validate the extracted data against. If provided, returns a validation result. |