Skip to main content
Glama

Clawhard Dev Tools

Repair broken or LLM-generated JSON

mend_repair_json
Read-onlyIdempotent

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. If the text is already valid it says so. Up to 100,000 characters.

Input Schema

NameRequiredDescriptionDefault
textYesThe broken JSON, or any text that contains JSON (a chat reply, a log line, a code block).
indentNoSpaces per indent level in the output. Default 2. Use 0 for one minified line.
sort_keysNoSort object keys alphabetically. Default false (keep the original order).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources