Check AI Replies Against a JSON Schema

    by Shogun Labs

    1

    Check saved AI JSON replies against a stated subset of Draft 2020-12 JSON Schema and locate parse errors and violations locally. Structural check only; it does not judge whether an answer is correct.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    Check AI Replies Against a JSON Schema

    Example session with this skill installed

    python3 scripts/check_ai_replies.py examples/reply.schema.json examples/replies.jsonl

    • Read your context and instructions
    • Compiled the check ai replies

    REPLY line=1 VALID
    REPLY line=2 INVALID violations=3
    path=# keyword=required message='confidence' is a required property
    path=#/answer keyword=type message=boolean is not of type 'string'
    path=#/extra keyword=additionalProperties message=extra property 'extra'
    REPLY line=3 PARSE-ERROR line 3: Expecting value: line 1 column 1 (char 0)
    REPLY line=4 VALID
    SUMMARY replies=3 parse_errors=1 unsupported_keywords=0

    Connects securely to your tools. The creator never sees your data.

    About this skill

    AI developers who pass saved structured replies to later code can catch missing fields, wrong types, and undeclared properties before integration fails. This checker shows each reply's parse errors and schema violations so a developer can choose what to fix or retry. It reads files locally and calls no external service.

    What it checks

    • Reads one schema JSON file and one response file (one JSON value, a JSON array, or JSON Lines with one value per nonblank line).
    • Marks each reply VALID, INVALID, or PARSE-ERROR. Invalid replies list a JSON Pointer path, the violated keyword, and a message.
    • Implements a stated subset of Draft 2020-12 assertion keywords (type, enum, const, properties, required, additionalProperties, items, length/size and numeric bounds, pattern, uniqueItems).
    • Names any keyword it does not implement in output as UNSUPPORTED ... not evaluated (for example $ref, allOf, anyOf, oneOf, if/then/else, patternProperties, multipleOf, format, and the content keywords). A reply is not treated as passing when its schema uses an unsupported keyword.
    • A malformed JSONL line is reported while valid lines before and after it are still checked.

    What it does not do

    • It does not retry or regenerate replies, call a model, or reach the network.
    • A clean result means only that the instance passes this schema evaluation; it does not establish that an AI answer is meaningful, factually correct, safe, or likely to pass a later application step.
    • pattern uses Python regular expressions, which may differ from the ECMA-262 dialect JSON Schema describes.

    Exit status

    0 all parsed replies pass and no unsupported keyword found; 1 a parse error, schema violation, or unsupported keyword was reported; 2 the schema or command could not be processed.

    Requirements

    Python 3.9+ standard library only. No third-party packages.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Does not assert format or content keywords. Structure only; no semantic validation. Unsupported keywords cause exit 1. Requires Python 3.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    Python 3.9+

    Permissions

    Terminal / Shell
    Read Files
    Listedtoday

    What's inside

    Frequently Asked Questions

    This skill uses deterministic code to verify that saved AI responses follow a Draft 2020-12 JSON Schema. It solves the problem of hallucinated validity by catching structural errors, missing keys, or incorrect types that linguistic models often overlook when asked to check their own work.

    To use this skill, you need a Draft 2020-12 JSON Schema file and a file containing your model replies in JSON, array, or JSONL format. It requires Python 3 to execute the local validation script.

    The skill identifies specific parse errors and schema violations within your data and generates a report detailing where the structural failures occurred. It also flags any unsupported assertion keywords used in your schema.

    This skill focuses strictly on structural integrity and does not assess the factual accuracy, meaning, or truth of the JSON content. It also treats format and content keywords as annotations rather than assertions and will exit if it encounters unsupported assertion keywords.

    You should provide your agent with the paths to your schema file and your replies file and ask it to run the validation script. For example, you can direct the agent to execute the script against a specific JSONL file to check for type consistency or structural errors.

    This skill is designed for high volume auditing and can process single JSON objects, arrays of values, or JSONL files. This makes it suitable for validating large synthetic datasets or batch extraction pipelines before they are imported into production.

    New in LLM Ops