# Check AI Replies Against a JSON Schema

> 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.

Check AI Replies Against a JSON Schema is a paid AI agent skill on Agensi by Shogun Labs, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Shogun Labs](https://www.agensi.io/creators/shota-nakahira)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/check-ai-replies-against-a-json-schema
- Tags: llm-ops, python, json-schema, data-validation, testing

## 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.

## Requires

- Python 3.9+

## Known limitations

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

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Check AI Replies Against a JSON Schema skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill help verify structured AI outputs compared to just asking an AI to check itself?

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.

### What files or software do I need to have ready before using this skill?

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.

### What kind of feedback does the skill provide after auditing my files?

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.

### Are there specific parts of a JSON file that this skill does not validate?

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.

### How do I direct my AI agent to perform a validation check using this skill?

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.

### Can this skill handle large batches of AI responses at once?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
