AnthropicClaude Certified Architect – Foundations2026-100 Prerequisites
Separate required fields from nullable values
Completed by the knowledge check
Learning objective
Define function-calling interfaces with JSON Schema types, required fields, and nullability.
Core idea
A function-calling interface is a contract for proposed arguments. A Claude user-defined tool carries a name, a description that says when the tool applies, and an input_schema, which Anthropic defines as a JSON Schema object.
Three questions stay separate: what type can a value have, must the property be present, and can its value be null? They are independent. A required property can accept null, and an optional property can reject null whenever it appears. Keeping them apart stops a missing argument from turning silently into a business decision.
How it works
{
"name": "lookup_order",
"description": "Look up an order in the authenticated customer's account before explaining refund eligibility. Does not change the order.",
"input_schema": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"include_items": { "type": "boolean" },
"reason": {
"type": ["string", "null"],
"description": "The customer's stated reason, or null if unknown."
}
},
"required": ["order_id", "reason"],
"additionalProperties": false
}
}lookup_order and its arguments are illustrative, not built-in tools.
Types. Use JSON Schema type names, not your implementation language’s. A JSON boolean is true, not the string "true"; an order reference that keeps its leading zeros is a string even though it contains digits.
Presence. JSON Schema’s properties describes a property when it appears; by default those properties are not required. The required array names the ones that must be present. Here order_id and reason must appear and include_items may be omitted. An object schema with properties but no required list accepts {}.
Nullability. JSON Schema has a null type, and type may be an array: ["string", "null"] accepts either, while a plain "string" rejects null. Presence is still decided by required.
| Argument | Result |
|---|---|
order_id missing, or order_id: null | Invalid |
reason missing | Invalid, although it accepts null |
reason: null | Valid: the reason is explicitly unknown |
extra refund_amount | Invalid, because of additionalProperties: false |
An optional nullable property therefore has three states — omitted, null, a value — and each needs a meaning before you expose it. By default JSON Schema allows properties the schema does not declare; additionalProperties: false turns an invented argument into a validation failure.
The schema describes shape only. Without strict: true, Anthropic warns that Claude might return incompatible types or omit required fields; 4.3.1 covers strict tool inputs. A valid object still does not prove the customer owns order_id, so authorization stays in the handler. Designing nullable fields and escape values so an extraction never has to invent a value is taught in 4.3.4.
Key distinctions and trade-offs
- Declared versus required:
propertiesconstrains a value;requireddemands the key. - Null versus absent:
nullis a value; absence is a missing key. Neither is an empty string. - Valid versus authorized: a well-formed argument can still name an order the caller may not see.
Required nullable fields make “unknown” explicit at the cost of a larger payload. Optional fields keep requests compact but need a defined omission policy.
Architecture / decision scenario
The team proposes marking every field of lookup_order optional and having the handler turn missing fields into null. You require order_id as a non-null string so no lookup runs without a target, require reason as string-or-null so the model can say the reason is unknown, leave include_items optional with a documented default, and reject extras. A proposal of reason: null passes; omitting reason, sending include_items: "true" or adding refund_amount fails validation before the handler runs its ownership check.
Common exam traps
- Assuming a property in
propertiesis required. - Reading
requiredas “not null”. - Equating a missing key,
nulland an empty string. - Sending string values for boolean arguments.
- Assuming object schemas reject unknown properties by default.
- Treating a valid argument shape as authorization.
What to remember
Types live in properties, presence in required, nullability in the type expression. Give omission and null a defined meaning, reject extras deliberately, and keep schema validation apart from authorization.
Knowledge check
In a tool’s input_schema, reason has type ["string", "null"] but is not listed in required. Claude sometimes omits it, and the handler cannot tell “the reason is unknown” from “the model left it out”. You want every call to state the reason, or state explicitly that it is unknown. Which schema change does that?
reason to "string" and keep it out of requiredreason to required and change its type to "string"reason into nullreason to required and keep its type ["string", "null"]required makes the key mandatory, and the null in the type lets the model say “unknown” explicitly. A required plain string rejects null rather than representing “unknown” explicitly. Mapping absence to null in the handler hides exactly the difference you need.A tool’s input_schema declares order_id as a required string, reason as required with type ["string", "null"], and include_items as an optional boolean. Which proposed input is valid?
{"order_id": "00412", "include_items": false, "reason": null}{"order_id": "00412", "include_items": "false", "reason": null}{"order_id": "00412", "include_items": false}{"order_id": 412, "include_items": false, "reason": null}reason must be present, and null is an allowed value for it. A JSON boolean is false , not the string "false" , and an order reference with leading zeros is a string: the number 412 fails the string type and loses the zeros. Omitting a required key fails even when its type accepts null.A lookup_order call passes schema validation with strict tool use enabled. Its order_id names an order that belongs to a different customer. What should happen next?
description restricts Claude to the caller’s own ordersorder_id can still name an order the caller may not see. Ownership is a fact about the data and the session, so the handler enforces it. A description only guides what Claude proposes.A tool’s input_schema declares order_id and reason under properties, each with a type. It has no required list and no additionalProperties keyword. Claude proposes an extra refund_amount, and the handler forwards every argument to the backend. Which change makes such an invented argument fail validation?
requiredadditionalProperties to falsedescriptiontype of each declared propertyproperties and its types constrain the keys it names and required demands them, but none of them rejects others; additionalProperties: false does. A description guides Claude without validating anything.References
- Anthropic, Define tools
- Anthropic, Strict tool use
- JSON Schema, Object
- JSON Schema, Type-specific keywords