CheckJSONCheckJSON

Make more tool calls work.

Fix malformed tool calls before they reach your app. CheckJSON repairs supported JSON and schema errors without asking the original model to start over.

Generated argument
"rooms": "Entry"
Repaired argument"rooms": ["Entry"]

What you can do with CheckJSON

Give smaller models a fair shot

Test a smaller model on your own tool calls. If it chooses the right action but formats an argument incorrectly, CheckJSON can often fix the format. Measure task success and repair cost before switching.

Spend fewer retries on formatting

Fix supported syntax and type errors with local rules. Reserve another model call for cases where the rules leave a gap.

See what changed before shipping

Inspect the candidate, applied edits, and returned status. During a client handoff or an incident review, show exactly what was repaired and what still needs a decision.

Keep the models and APIs you use

Add CheckJSON between model output and tool execution. Try it first on one tool, then compare outcomes before rolling it out across a workflow.

+52.86 percentage points in valid calls on RestGPT

On 157 RestGPT queries, CheckJSON increased schema-valid calls from 46.50% to 99.36%. In the controlled benchmark, it preserved 9,724 of 9,726 clean calls and correctly handled 18,379 of 20,674 controlled tasks (88.90%). On recorded Llama-3.1-8B outputs, it corrected 608 previously incorrect outputs and made 20 previously correct outputs incorrect. Both evaluations drew from the task pool used to refine the rules.

Explore the research results

From install to repaired call

01 / 04 Install CheckJSON

Terminal
pip install checkjson-repair

For the alpha release, use pip install --pre checkjson-repair.

02 / 04 Import the repair function

repair.py
from checkjson import RulesOnly

checker = RulesOnly()

Rules-only repair runs locally and needs no API key.

03 / 04 Watch the JSON get fixed

repair.py
result = checker.repair(task, trace=True)

Candidate arguments

{ "area": 'Entry', "domain": "lock" }

Repaired arguments

{ "area": "Entry", "domain": ["lock"] }
Open the full Smart Lock trace

04 / 04 Check your dashboard

Terminal
checkjson tui
ckjn tui
CheckJSON Dashboard showing one repaired call in the demo project

Press F3 to see your project’s outcomes and recent runs.

The same CheckJSON Dashboard opened with the ckjn shortcut

Free to use, including for client work

CheckJSON is MIT-licensed. Run rules locally with no API key. Optional model providers may charge for their calls.

Read the license

How the 20,674 benchmark calls were made

Loading…