JSON schema type mismatches

json-schema-type-mismatches · version 1.0.0 · JSON & JSONL · free, no key needed

List every value whose JSON type fails a JSON Schema 2020-12 "type" keyword, with expected and actual types.

Use when you need to: find wrong types in llm json output · which values have the wrong json type for the schema · list type mismatches with expected and actual type.

Decide before calling

Read the versioned contract and the supported scope below. Reuse json-schema-type-mismatches@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-type-mismatches@1.0.0 for find wrong types in llm json output. 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",
    "properties": {
      "age": {
        "type": "integer"
      },
      "tags": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  },
  "instance": {
    "age": "42",
    "tags": [
      "a",
      3
    ]
  }
}

Response:

{
  "result": {
    "valid": false,
    "count": 2,
    "truncated": false,
    "mismatches": [
      {
        "instance_pointer": "/age",
        "expected": [
          "integer"
        ],
        "actual": "string",
        "keyword_location": "/properties/age/type",
        "schema_pointer": "/properties/age/type"
      },
      {
        "instance_pointer": "/tags/1",
        "expected": [
          "string"
        ],
        "actual": "integer",
        "keyword_location": "/properties/tags/items/type",
        "schema_pointer": "/properties/tags/items/type"
      }
    ]
  }
}

How to call it

MCP

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

{
  "id": "json-schema-type-mismatches",
  "version": "1.0.0",
  "input": {
    "schema": {
      "type": "object",
      "properties": {
        "age": {
          "type": "integer"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "instance": {
      "age": "42",
      "tags": [
        "a",
        3
      ]
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/json-schema-type-mismatches/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","properties":{"age":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}}}},"instance":{"age":"42","tags":["a",3]}}'

The machine-readable contract is at /v1/tools/json-schema-type-mismatches/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.