# Required property not defined

> ax-check rule: The schema marks a property as required but never defines it, or the required list is malformed.

Section: ax-check rule · Descriptions and schemas  
Canonical: https://agentexperience.tech/checks/axc-d018/

The schema marks a property as required but never defines it, or the required list is malformed.

- **How serious**: **error** Something is broken or missing.
- **Kind of check**: **[Conformance](https://agentexperience.tech/checks/#kinds)** A finding is a fact about the input.
- **ax-check command**: `ax-check lint`
- **Where it applies**: MCP tool lists, OpenAPI
- **Topics**: [schema-enum](https://agentexperience.tech/evidence/#pattern-schema-enum), [error-recovery](https://agentexperience.tech/evidence/#pattern-error-recovery)
- **Rule text from**: ax-check 0.2.0Documented ahead of release

**Fix in one line** Define every required property under "properties", or remove it from "required".

The input schema marks a property as required but never defines it, or its `required` list is malformed. In a closed schema, a required property that is not defined cannot be sent at all, so no call can ever be valid. An agent that follows the schema gets an error it has no way to fix.

## What it checks

For each MCP tool’s `inputSchema` and each OpenAPI operation’s JSON request body schema, ax-check checks the top-level `required` keyword:

- `required` must be an array. A value such as `"required": true` or `"required": "email"` is reported.
- Every entry in the array must be a string. A number or object in the list is reported.
- No property may be listed twice.
- In a closed schema (`"additionalProperties": false`), every required property must appear under `properties`.

These checks mirror four checks in the `audit_agent_path` tool on agentexperience.tech: `catalog.malformed_required_array`, `catalog.malformed_required_entry`, `catalog.duplicate_required_property` and `catalog.required_property_not_defined`.

## Why it matters

An agent builds its arguments from the schema. When the schema requires `customer_id` but `properties` only defines `customerId`, and unknown properties are rejected, the agent has two choices and both fail: leave `customer_id` out and break the required rule, or send it and break the closed object rule. The agent sees an error that it cannot recover from by reading the schema again.

Malformed `required` values are a common leftover from other schema dialects, where `required: true` sat on each property. Different validators may handle these values differently, so the same tool can behave one way in one client and another way in the next.

## How to fix

- Define every required property under `properties`, with the exact same spelling.
- Or remove the name from `required` if callers should not send it.
- Make `required` an array of unique strings, or remove it when nothing is required.

## Example

### Before

```json
{
  "name": "create_invoice",
  "inputSchema": {
    "type": "object",
    "properties": {
      "customerId": { "type": "string", "description": "The customer's ID, for example cus_123." },
      "amount": { "type": "number", "description": "Total in the invoice currency." }
    },
    "required": ["customer_id", "amount", "amount"],
    "additionalProperties": false
  }
}
```

### After

```json
{
  "name": "create_invoice",
  "inputSchema": {
    "type": "object",
    "properties": {
      "customer_id": { "type": "string", "description": "The customer's ID, for example cus_123." },
      "amount": { "type": "number", "description": "Total in the invoice currency." }
    },
    "required": ["customer_id", "amount"],
    "additionalProperties": false
  }
}
```

## How ax-check detects it

ax-check reads the top-level `required` keyword of the input schema and reports each problem at its exact position (for example `/tools/0/inputSchema/required/0`).

A required property that is missing from `properties` is reported only when the schema is closed: `additionalProperties` is `false` and the schema uses none of `$ref`, `oneOf`, `anyOf`, `allOf`, `not`, `if`, `then`, `else`, `patternProperties` or a list of types, either at the top level or directly on a property. One exception: a top-level `anyOf` whose branches only list `required` (the usual way to say “send at least one of these fields”) is allowed. In an open schema, the property may still be allowed through `additionalProperties`, a pattern or composition, so this is not a proven contradiction. Like the agentexperience.tech audit, ax-check does not report a required property that is missing from an open schema. (The audit lists that case as inconclusive; ax-check stays silent.)

Known false negatives:

- Only the top-level input schema is checked. A `required` list inside a nested object is not.
- For OpenAPI, only the JSON request body schema is checked. The `required` flag on path, query and header parameters is a separate field and is not part of this rule.
- Open schemas are never reported for missing properties, as described above.

If the finding does not apply, silence it with `--disable <rule-id>`.

## Sources

- Specification: Model Context Protocol, Tools, revision 2026-07-28. [https://modelcontextprotocol.io/specification/2026-07-28/server/tools](https://modelcontextprotocol.io/specification/2026-07-28/server/tools). A tool’s `inputSchema` is the JSON Schema clients use to build and check arguments.
- Specification: OpenAPI Specification v3.1.0, OpenAPI Initiative, 15 February 2021. [https://spec.openapis.org/oas/v3.1.0](https://spec.openapis.org/oas/v3.1.0). Request bodies are described with JSON Schema objects.
- Guide: Write tool descriptions an agent can act on, agentexperience.tech, retrieved 2026-10-08. [https://agentexperience.tech/insights/tool-descriptions/](https://agentexperience.tech/insights/tool-descriptions/). Put closed sets in the schema and set `additionalProperties` to false.
- Related check: the agentexperience.tech `audit_agent_path` tool reports the same defects as `catalog.malformed_required_array`, `catalog.malformed_required_entry`, `catalog.duplicate_required_property` and `catalog.required_property_not_defined`.

## Related evidence

Records in the [AX evidence register](https://agentexperience.tech/evidence/) about the same pattern as this rule. They don’t test the rule itself.

- [Constraints stated only in prose produce silent failures on live APIs](https://agentexperience.tech/evidence/ev-0002/): SilentProbe (preprint) reports that only 7.5% of 2,501 public OpenAPI documents declare an enum, and that on live endpoints machine-checkable constraints returned an honest error in 111 of 111 cases while prose-only constraints failed silently in 44 of 61. Preprint: not yet peer reviewed
- [An enum in the schema ends silent failures from example-only vocabularies](https://agentexperience.tech/evidence/ev-0001/): SilentProbe (preprint) reports that a vocabulary a parameter description only exemplified ("e.g.") was missed on 88 of 88 attempts across twelve models, and that promoting it into the schema cut the failure to 0 of 89. Preprint: not yet peer reviewed
- [Error text that names the next tool lifts recovery](https://agentexperience.tech/evidence/ev-0003/): A preprint testing five OpenAI models reports that an expired-credential error naming a terminal command left 45% of tasks recovered, naming the server's login tool instead raised recovery to 84%, and on rate limits naming the call to repeat raised recovery from 6% to 88%. Preprint: not yet peer reviewed
- [Naming recovery tools is the active ingredient in failure receipts](https://agentexperience.tech/evidence/ev-0004/): Outcome Monitors (preprint) reports that receipts naming a violated outcome and the public recovery tools raised ToolMaze completion from 10.9% to 28.1% across four models, and that removing the list of recovery tools eliminated the gain. Preprint: not yet peer reviewed
- [Idempotency keys cut duplicate writes from 28% to 4%](https://agentexperience.tech/evidence/ev-0005/): LIMBO (preprint) reports that offering an idempotency key on every write cut duplicate side effects from 28% to 4% of episodes because agents use keys when they exist, and that agents reported success in 90% of the episodes in which they had duplicated an effect. Preprint: not yet peer reviewed

## Related guides

- [Write tool descriptions an agent can act on](https://agentexperience.tech/insights/tool-descriptions/): How to write tool names, descriptions and JSON schemas that help an AI agent choose correctly, and why tool text deserves review like interface copy. Guide
- [Agent error recovery: design the path back](https://agentexperience.tech/insights/design-for-recovery/): Agent error recovery in practice: what a failure response must say, when a retry is safe, how to handle partial completion, and when to escalate. Guide

## Go here next

- [Write tool descriptions an agent can act on](https://agentexperience.tech/insights/tool-descriptions/): The text around a tool affects whether an agent can find it, choose it, and use it well. Guide
- [Constraints stated only in prose produce silent failures on live APIs](https://agentexperience.tech/evidence/ev-0002/): SilentProbe (preprint) reports that only 7.5% of 2,501 public OpenAPI documents declare an enum, and that on live endpoints machine-checkable constraints returned an honest error in 111 of 111 cases while prose-only constraints failed silently in 44 of 61. Evidence
- [Example does not match the schema](https://agentexperience.tech/checks/axc-d019/): A published example call fails the schema it illustrates, so an agent copying it gets an error. Rule

## About this rule text

[Context footprint estimate](https://agentexperience.tech/checks/axc-d017/)

[Example does not match the schema](https://agentexperience.tech/checks/axc-d019/)

[All ax-check rules](https://agentexperience.tech/checks/)

Rule text from ax-check 0.2.0, by Himadri Mishra. The licence will be confirmed before the source repository is published.
