mend_repair_json
Repair broken or LLM-generated JSON
Use when JSON from an LLM, API, log, config or copy-paste fails to parse (JSON.parse error, "Unexpected token", "Expecting property name"), or the user pastes JSON with trailing commas, single quotes, unquoted keys, comments, Python True/False/None, NaN, missing commas or brackets, a ```json fence, text around it, or output that was cut off. Deterministic repair: returns valid, formatted JSON plus a list of every fix with line and column. Values are never rewritten, so big numbers, number formatting and key order stay exactly as written (re-asking a model to "fix the JSON" changes data and costs tokens). If the text is already valid it says so. Up to 100,000 characters.
输入参数text必填indentsort_keys
mend_check_json
Validate JSON and locate the exact error
Use when you need to know whether text is strictly valid JSON, and if not, exactly where it breaks. Strict RFC 8259 check (the same accept/reject as JSON.parse). Returns line, column, the offending line with a caret and whether Mend can repair it. Use mend_repair_json to fix it. Up to 100,000 characters.
输入参数text必填
mend_outline_json
Outline the structure of a large JSON payload
Use when you are about to read a big JSON response, log or export into context, before loading it: returns a compact outline of the structure (keys, types, array lengths, one example per repeated shape) so you can plan a query without spending tokens on the whole document. Repairs the JSON first if needed. Follow with mend_query_json to pull only the values you need. Up to 100,000 characters.
输入参数text必填max_depthmax_items
mend_query_json
Extract values from JSON by path
Use when you need specific fields from a JSON document without reading all of it: $.users[0].name, $.items[*].id, $.a.b[-1], $.list[1:3], $..email (recursive). Returns each match with its exact path, type and value. Repairs the JSON first if needed, so broken input still works. Up to 100,000 characters.
输入参数maxpath必填text必填