Fix Invalid JSON from AI
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Turn a failed case into a fix — diagnose where in the agent's flow it went wrong, categorize the failure, and point at the prompt, tool, or context that caused it.
An agent that fails a case isn't useful feedback until you know WHY it failed — bad instruction, wrong retrieval, a tool error, or a reasoning slip. This prompt analyzes a failure: it walks the agent's trace to find where it went off the rails, categorizes the failure type, identifies the likely root cause (prompt, context, tool, or model), and recommends where the fix belongs — so evaluation feeds improvement instead of just a red mark.
Assemble the failed case
Gather the agent trace for the case that failed, the task it was given, and what the correct behavior would have been. The analysis needs the full path to find where it went wrong.
Open this resource in AI Output Validator
Load the prompt into AI Output Validator and paste in the failed run. The tool runs the analysis so you get the failure category and likely root cause without tracing by hand.
Review the root-cause findings
Read where the failure occurred, its category, and whether the cause points at the prompt, the context, a tool, or the model.
Send the fix to the right layer
Apply the recommendation to whichever layer it names - instruction, retrieval, or tool - then re-run the case to confirm the failure is gone.
Step 3 (ROOT CAUSE) forces the blame onto exactly one owning layer - PROMPT/instructions, CONTEXT/retrieval, a TOOL, or the MODEL itself - rather than settling for 'the AI was wrong'. Step 4 (NOT THE CAUSE) rules out the layers that worked so the fix isn't misdirected. Run over the trace you paste in the assistant you choose, the named layer is a diagnosis; you apply the fix.
Its RULES pin the analysis to the FIRST point where the agent went wrong, because later steps often just inherit that error - a bad retrieval quietly poisons the reasoning and the final generation. Step 1 (WHERE) pinpoints that first break across instruction-following, retrieval, tool call, reasoning, or final generation, so you fix the source rather than a downstream symptom that would reappear on re-run.
Step 6 (PATTERN) labels the case a one-off or a recurring class of failures, and step 5 (FIX LOCATION) names where the change belongs with a concrete suggestion. Both are suggestions, not actions: you decide whether to write the new eval case, apply the FIX LOCATION change to that layer, then re-run the failed case to confirm it now passes.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Paste the response, get the verdict: real JSON parsing, missing-field detection, and a repair prompt for everything found.
Grade agent output the same way every time — a rubric scoring correctness, grounding, safety, tone, and completeness, with a pass threshold instead of a gut call.
Stop getting 'Sure, here is the JSON…' — the output-contract pattern that forces models to return only parseable JSON: schema, example, and a strict rule block.
Free text in, named fields out. The extraction prompt pattern that turns any unstructured text into consistent, parseable records.
Billing, Technical, Account, How-To, Feature Request — ticket triage with definitions that decide the borderline cases for the model.
Paste an AI's output and validate it against the expected format — with a repair prompt for every failure found.