Validate JSON against a JSON Schema (every error with its path)
jig_validate_jsonUse when the user asks whether some JSON matches a JSON Schema, or when JSON from a model reply, structured output, tool call, API response or file has to be checked against its schema before it is used or stored (signals: "validate this JSON", "does this match the schema", "which field is wrong", "the model returned bad JSON", "check the tool-call arguments", "why does my parser reject this"). Validates a JSON value (data), or raw model text (json_text: a ```json fence or prose around one JSON value is stripped; a syntax error comes back with line and column), against JSON Schema draft 2020-12, 2019-09, 07, 06 or 04, including $ref/$defs, anyOf/oneOf/allOf, if/then/else, unevaluatedProperties, patterns and formats (email, date-time, date, time, uuid, uri, hostname, ipv4, ipv6, duration). Returns valid true/false, every problem with its JSON Pointer path, keyword, expected and got values, and retry_message: a ready-to-send list of fixes for the model that produced the JSON. Example: {"schema":{"type":"object","properties":{"price":{"type":"number"}},"required":["price","sku"]},"data":{"price":"12.50"}}. Gives the expected answer on 6,018 of 6,227 official JSON-Schema-Test-Suite cases (ajv 8: 5,981); most misses are external $ref URLs, which are not fetched, $dynamicRef, and the idn-email, idn-hostname and iri formats, which are not checked. Not for repairing broken JSON syntax or for checking whether a schema works with OpenAI, Claude or Gemini (jig_check_schema).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"schema": "<schema>"
},
"name": "jig_validate_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | The JSON value to check: object, array, string, number, boolean or null. Use this or json_text. | |
| draft | No | Force a draft: 2020-12, 2019-09, 7, 6 or 4. Default: from $schema, else 2020-12. | |
| schema | Yes | The JSON Schema, as a JSON object (not a string). $schema picks the draft; default 2020-12. | |
| json_text | No | Raw text that should contain one JSON value, for example a model reply. Code fences and text around the JSON are stripped. Use this or data. | |
| max_errors | No | Most errors to list (default 50). error_count is always the full count. | |
| check_formats | No | Check "format" (email, date-time, uuid, uri, ...). Default true. |