# JSON schema required missing

`json-schema-required-missing` · version 1.0.0 · JSON & JSONL · free, no key needed

List every property a JSON Schema 2020-12 "required" keyword demands but the instance lacks, with JSON Pointers.

**Use when you need to: find missing required properties in llm json output · which required fields are missing from this json · list required keys absent at every nesting level.**

## Decide before calling

Read the [versioned contract](/v1/tools/json-schema-required-missing/versions/1.0.0) and the supported scope below. Reuse `json-schema-required-missing@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-required-missing@1.0.0` for find missing required properties 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

- find missing required properties in llm json output
- which required fields are missing from this json
- list required keys absent at every nesting level
- json pointer of each missing required field
- check structured output for missing required properties
- report required property violations against a 2020-12 schema

## Not supported

- repairing the output by inserting default values for the missing properties
- other assertions (type, enum, minLength, pattern, format): see json-schema-type-mismatches for type
- schemas using allOf/anyOf/oneOf/not/if/patternProperties/dependentSchemas, remote or anchor $ref (unsupported_input)

## Behavior

- Validation 6.5.3: at each object instance location, every name in an applicable schema's "required" array that is not an own property of the object is reported; non-objects ignore "required". A property whose value is null is present.
- Applicability follows Core 2020-12: properties (10.3.2.1), additionalProperties as a subschema (10.3.2.3), items as a single subschema (10.3.1.2), same-document fragment $ref with sibling keywords (8.2.3.1), $defs, and boolean subschemas (4.3.2). Other keywords are ignored (Core 6.5) except the unsupported applicators, which throw unsupported_input.
- instance_pointer is the object location and property_pointer the location the missing member would have, both RFC 6901 JSON string representations ("" is the root; "~" -> "~0", "/" -> "~1"). keyword_location is the evaluation path including "$ref" steps (Core 12.3.1); schema_pointer is the "required" keyword's own location in the schema document.
- Order: instance locations in pre-order (object members by ascending UTF-16 code units of their names, array elements by index); at one location, applicable schemas in application order (the schema, then its $ref chain); within one keyword, the order of the "required" array.
- count is the total number of missing properties; at most max_results are listed, in order, and truncated is true when count exceeds it. valid is true exactly when count is 0.
- Input must be JSON only: non-finite numbers, holes, non-plain objects, and lone surrogates in any string or any property name (schema or instance) throw invalid_input. A $ref cycle with no instance progress throws not_computable (Core 9.4.1).

## Input

- `schema` (object or boolean, required): A JSON Schema 2020-12 schema (object or boolean).
- `instance` (any JSON value, required): The JSON value to diagnose (any JSON value).

## Output

- `valid` (boolean, required)
- `count` (integer, required): min 0
- `truncated` (boolean, required)
- `missing` (array of object, required): max items 256

## Limits

- max input bytes: 262144
- max depth: 64
- max nodes: 20000
- max schema evaluations: 100000
- max results: 256
- max output bytes: 1048576

## Example

Request input:

```json
{
  "schema": {
    "type": "object",
    "properties": {
      "user": {
        "type": "object",
        "required": [
          "id",
          "email"
        ]
      }
    },
    "required": [
      "user",
      "total"
    ]
  },
  "instance": {
    "user": {
      "id": 7
    }
  }
}
```

Response:

```json
{
  "result": {
    "valid": false,
    "count": 2,
    "truncated": false,
    "missing": [
      {
        "instance_pointer": "",
        "property": "total",
        "property_pointer": "/total",
        "keyword_location": "/required",
        "schema_pointer": "/required"
      },
      {
        "instance_pointer": "/user",
        "property": "email",
        "property_pointer": "/user/email",
        "keyword_location": "/properties/user/required",
        "schema_pointer": "/properties/user/required"
      }
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "json-schema-required-missing",
  "version": "1.0.0",
  "input": {
    "schema": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "required": [
            "id",
            "email"
          ]
        }
      },
      "required": [
        "user",
        "total"
      ]
    },
    "instance": {
      "user": {
        "id": 7
      }
    }
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-schema-required-missing/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","properties":{"user":{"type":"object","required":["id","email"]}},"required":["user","total"]},"instance":{"user":{"id":7}}}'
```

The machine-readable contract is at [/v1/tools/json-schema-required-missing/versions/1.0.0](/v1/tools/json-schema-required-missing/versions/1.0.0).

### CLI

```sh
node cli.mjs run json-schema-required-missing 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [JSON schema additional find](/tools/json-schema-additional-find): Find every member a JSON Schema 2020-12 "additionalProperties": false forbids, with the member's JSON Pointer.
- [JSON schema type mismatches](/tools/json-schema-type-mismatches): List every value whose JSON type fails a JSON Schema 2020-12 "type" keyword, with expected and actual types.
- [JSON schema batch validate](/tools/json-schema-batch-validate): Validate many JSON records against one Draft 2020-12 subset schema; per-record validity, error pointers, counts.
- [JSON schema output validate](/tools/json-schema-output-validate): Validate JSON (e.g. LLM output) against a Draft 2020-12 schema subset; returns spec output units with JSON Pointers.
- [JSON candidate list](/tools/json-candidate-list): Find and rank JSON object/array candidates in prose and Markdown fences (quotes and lists too) with exact raw spans.
- [JSON fence extract](/tools/json-fence-extract): List Markdown fenced code blocks (CommonMark 0.31.2) with exact spans, unwrapped content and an RFC 8259 JSON check.
