JSON schema batch validate

json-schema-batch-validate · version 1.0.0 · JSON & JSONL · free, no key needed

Validate many JSON records against one Draft 2020-12 subset schema; per-record validity, error pointers, counts.

Use when you need to: validate a batch of generated json records against one schema · check every llm generated object in a list against json schema 2020-12 · per record json schema errors with json pointer paths.

Decide before calling

Read the versioned contract and the supported scope below. Reuse json-schema-batch-validate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use json-schema-batch-validate@1.0.0 for validate a batch of generated json records against one schema. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "schema": {
    "type": "object",
    "required": [
      "sku",
      "qty"
    ],
    "properties": {
      "sku": {
        "type": "string"
      },
      "qty": {
        "type": "integer",
        "minimum": 1
      }
    }
  },
  "items": [
    {
      "sku": "A1",
      "qty": 2
    },
    {
      "sku": "B2",
      "qty": 0
    },
    {
      "qty": 1.5
    }
  ]
}

Response:

{
  "result": {
    "item_count": 3,
    "valid_count": 1,
    "invalid_count": 2,
    "error_count": 3,
    "truncated": false,
    "results": [
      {
        "index": 0,
        "valid": true,
        "errors": [],
        "truncated": false
      },
      {
        "index": 1,
        "valid": false,
        "errors": [
          {
            "keyword_location": "/properties/qty/minimum",
            "instance_location": "/qty",
            "keyword": "minimum",
            "params": {
              "limit": 1
            }
          }
        ],
        "truncated": false
      },
      {
        "index": 2,
        "valid": false,
        "errors": [
          {
            "keyword_location": "/required",
            "instance_location": "",
            "keyword": "required",
            "params": {
              "property": "sku"
            }
          },
          {
            "keyword_location": "/properties/qty/type",
            "instance_location": "/qty",
            "keyword": "type",
            "params": {
              "expected": [
                "integer"
              ],
              "actual": "number"
            }
          }
        ],
        "truncated": false
      }
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "json-schema-batch-validate",
  "version": "1.0.0",
  "input": {
    "schema": {
      "type": "object",
      "required": [
        "sku",
        "qty"
      ],
      "properties": {
        "sku": {
          "type": "string"
        },
        "qty": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "items": [
      {
        "sku": "A1",
        "qty": 2
      },
      {
        "sku": "B2",
        "qty": 0
      },
      {
        "qty": 1.5
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/json-schema-batch-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","required":["sku","qty"],"properties":{"sku":{"type":"string"},"qty":{"type":"integer","minimum":1}}},"items":[{"sku":"A1","qty":2},{"sku":"B2","qty":0},{"qty":1.5}]}'

The machine-readable contract is at /v1/tools/json-schema-batch-validate/versions/1.0.0.

CLI

node cli.mjs run json-schema-batch-validate 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.