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.
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. |