# JSON schema additional find

`json-schema-additional-find` · version 1.0.0 · JSON & JSONL · free, no key needed

Find every member a JSON Schema 2020-12 "additionalProperties": false forbids, with the member's JSON Pointer.

**Use when you need to: find extra keys the schema does not allow · which properties are disallowed by additionalproperties false · list unexpected fields in llm structured output.**

## Decide before calling

Read the [versioned contract](/v1/tools/json-schema-additional-find/versions/1.0.0) and the supported scope below. Reuse `json-schema-additional-find@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-additional-find@1.0.0` for find extra keys the schema does not allow. 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 extra keys the schema does not allow
- which properties are disallowed by additionalproperties false
- list unexpected fields in llm structured output
- json pointer of every extra property in strict mode output
- detect hallucinated keys not declared in the schema
- report additional property violations at every nesting level

## Not supported

- deleting the extra members (this tool only reports them)
- validating members against a schema-valued additionalProperties (use json-schema-type-mismatches for their type)
- schemas using patternProperties, unevaluatedProperties, allOf/anyOf/oneOf, remote or anchor $ref (unsupported_input)

## Behavior

- Core 10.3.2.3: at each object instance location, a member is additional for a schema object when its name is not an own key of that same schema object's "properties"; it is reported when that schema's additionalProperties is the boolean false. Names declared only in a $ref target or sibling schema do not count (keywords see only their own schema object).
- A schema-valued additionalProperties is applied to the additional members (they are traversed for nested findings) but is not itself reported, because whether such a member fails depends on assertions outside this tool. additionalProperties true or absent allows everything.
- Applicability follows Core 2020-12: properties, additionalProperties, items as a single subschema, same-document fragment $ref with sibling keywords, $defs and boolean subschemas. Other keywords are ignored (Core 6.5) except the unsupported applicators, which throw unsupported_input.
- instance_pointer is the forbidden member's location, object_pointer its parent object, both RFC 6901 JSON string representations; keyword_location is the evaluation path to the additionalProperties keyword including "$ref" steps (Core 12.3.1); schema_pointer is that keyword's location in the schema document.
- Order: pre-order over instance locations with object members by ascending UTF-16 code units of their names and array elements by index; for one member, applicable parent schemas in application order. count is the total; at most max_results are listed 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)
- `additional` (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": {
      "name": {
        "type": "string"
      },
      "tags": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "k": {}
          },
          "additionalProperties": false
        }
      }
    },
    "additionalProperties": false
  },
  "instance": {
    "name": "x",
    "note": "extra",
    "tags": [
      {
        "k": 1,
        "v": 2
      }
    ]
  }
}
```

Response:

```json
{
  "result": {
    "valid": false,
    "count": 2,
    "truncated": false,
    "additional": [
      {
        "instance_pointer": "/note",
        "object_pointer": "",
        "property": "note",
        "keyword_location": "/additionalProperties",
        "schema_pointer": "/additionalProperties"
      },
      {
        "instance_pointer": "/tags/0/v",
        "object_pointer": "/tags/0",
        "property": "v",
        "keyword_location": "/properties/tags/items/additionalProperties",
        "schema_pointer": "/properties/tags/items/additionalProperties"
      }
    ]
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "json-schema-additional-find",
  "version": "1.0.0",
  "input": {
    "schema": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "k": {}
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "instance": {
      "name": "x",
      "note": "extra",
      "tags": [
        {
          "k": 1,
          "v": 2
        }
      ]
    }
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-schema-additional-find/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"k":{}},"additionalProperties":false}}},"additionalProperties":false},"instance":{"name":"x","note":"extra","tags":[{"k":1,"v":2}]}}'
```

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

### CLI

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

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

## Related tools

- [JSON schema required missing](/tools/json-schema-required-missing): List every property a JSON Schema 2020-12 "required" keyword demands but the instance lacks, with JSON Pointers.
- [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 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.
- [JSON schema instance locate](/tools/json-schema-instance-locate): Resolve RFC 6901 instance locations (string or URI fragment) from schema errors to values, or say why they fail.
- [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.
