# JSON Schema validator

Validate JSON against a JSON Schema and list every violation with its location.

- Endpoint: `POST https://setget.net/v1/tools/json-schema-validate` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `json-schema-validate`
- Page: https://setget.net/tools/json-schema-validate

## Inputs

- `text` (required, string): The JSON document to validate.
- `schema` (required, string): The JSON Schema.

## Example 1

```json
{"input":{"text":"{\"name\":\"Sam\",\"age\":\"31\"}","schema":"{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"}}
```

Result:

```json
{"valid":false,"errors":[{"path":"$.age","message":"'31' is not of type 'integer'","rule":"type"}]}
```

## Example 2: A valid document

```json
{"input":{"text":"{\"name\":\"Sam\",\"age\":31}","schema":"{\"type\":\"object\",\"required\":[\"name\"]}"}}
```

Result:

```json
{"valid":true,"errors":[]}
```

**Which schema drafts work?** The draft named in "$schema" is used. Without one, the latest draft (2020-12) applies.

**Are remote $ref URLs fetched?** No. This tool never makes network requests, so every $ref must point inside the schema.
