utilpeek: validate JSON against a JSON Schema
validate_jsonValidate JSON against a JSON Schema, returning up to 100 errors with instance and schema paths; invalid schemas and remote $refs are rejected.
Instructions
utilpeek: Validate JSON against a JSON Schema. To pull JSON out of prose use extract_json_with_schema; to convert formats use convert_data. Returns whether a JSON value is valid against a JSON Schema (draft from $schema, default 2020-12; 2019-09, 7, 6, 4 and 3 recognised), with up to 100 errors (instance path, schema path, message, validator) and the formats checked. Remote $ref documents are refused (422 remote_ref_forbidden), never fetched. Input: instance and schema; together at most 1 MB. An invalid schema is a 422 invalid_schema. Parsed in an isolated, resource-limited child process without network; input over its limits is a 422 (not charged). Typically under 0.5 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored. Docs: https://tanod.dev/learn/json-schema-validation-api.html
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | JSON Schema (draft from $schema; default 2020-12). Remote $ref documents are refused, never fetched. | |
| instance | Yes | Any JSON value to validate. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| draft | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| valid | No | ||
| errors | No | ||
| source | No | ||
| truncated | No | ||
| error_count | No | ||
| formats_checked | No |