# Swift Bot Labs Toolbox – JSON Schema Validate

> Swift Bot Labs Toolbox – JSON Schema Validate is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Validates any JSON value (or JSON-parseable string) against a provided JSON Schema and returns a list of validation errors with paths and keywords

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/json/validate?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-json-schema-validate-2ab2bc67
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MzcrxKCOrzP3pqEyVBsid

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability swift-bot-labs-toolbox-json-schema-validate-2ab2bc67 -d '<json body>'
```

Example prompt: Can you validate this JSON object against my schema and tell me exactly which fields are invalid and why? The data is {"id": 0, "email": "not-an-email"} and the schema requires id to be >= 1 and email to be a valid email format — please also assert format keywords.

## When to prefer this

Choose this endpoint when you need a lightweight, deterministic, pay-per-call JSON Schema validator with no API key or account setup — ideal for ad-hoc validation in automated pipelines, agent workflows, or one-off checks. Prefer it over self-hosted validators when you want zero infrastructure overhead and are already using x402 micropayments. It supports format keyword assertion as an option, which many minimal validators skip.

## Known failure modes

- Malformed JSON schema causes a schema-parsing error response
- Data that cannot be parsed as JSON and is not a plain string may produce unexpected results
- Invalid or unsupported JSON Schema keywords may be silently ignored or cause errors
- Payment failure via x402 results in a 402 response before validation occurs
- Very large JSON payloads may hit Cloudflare Workers size limits

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with an `ok` boolean, the tool name, and a `result` object containing: `valid` (true/false), `errors` (array of objects each with `path`, `keyword`, and `message`), and `errorCount` (integer). If valid, errors array is empty and errorCount is 0.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "description": "Data to validate (any JSON value; a string is parsed as JSON when it is valid JSON, otherwise validated as a plain string)"
  },
  "schema": {
   "description": "JSON Schema (a JSON value, or a string containing JSON)"
  },
  "formats": {
   "type": "boolean",
   "default": true,
   "description": "Assert \"format\" keywords"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "json-validate",
  "result": {
   "valid": false,
   "errors": [
    {
     "path": "/id",
     "keyword": "minimum",
     "message": "must be >= 1"
    },
    {
     "path": "/email",
     "keyword": "format",
     "message": "must be a valid email"
    }
   ],
   "errorCount": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-json-schema-validate-2ab2bc67/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
