Certopolis

Claude Certified Architect – Foundations

Strict tool use: strict: true on tool definitions

Set "strict": true on a tool definition and Claude's tool calls are guaranteed to match your input_schema. The API constrains sampling to schema-valid output, so the input always fits the schema and the tool name is always valid.

How it works

strict is a top-level property of the tool, next to name, description and input_schema. It is not part of tool_choice. The API compiles the schema into a grammar and samples only tokens that fit it. This is the same pipeline structured outputs use, and the schema follows the same JSON Schema limits.

Without strict mode, Claude can return "2" where you need 2, or leave out a required field. With strict: true, a booking tool that declares passengers as an integer always gets passengers: 2. Your handler can drop retry logic for bad argument types and for unknown tool names. The valid name is one of your tools or a server tool.

What it does not cover

Strict mode guarantees two things: the input matches the schema, and the name is a valid tool. It does not force a call on every turn and does not limit a response to one call. For those, use tool_choice and disable_parallel_tool_use.

It is rejected on the computer use and browser use toolsets and is not available on mcp_toolset. Tools with strict: true cannot be called through programmatic tool calling. It does work with tool search: the grammar is built from the full declared toolset, so deferred tools and strict mode combine without recompiling.

Data retention

Compiled schemas are cached for up to 24 hours since last use, separately from message content. Strict tool use is HIPAA eligible, but protected health information must not appear in the schema: not in property names, enum values, const values or pattern expressions. Keep PHI in the messages, where it is protected.

Where the exam catches people

  • Believing strict belongs inside tool_choice: it goes on each tool definition.
  • Believing strict mode forces a tool call or a single call: it only guarantees valid inputs and a valid tool name.
  • Believing HIPAA eligibility covers the schema too: cached schemas lack PHI protections, so PHI must stay out of them.
  • Believing tool search forces a grammar rebuild on each discovery: the grammar comes from the full toolset, so the two compose.

Written from Anthropic's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. Your team sets strict: true on every custom tool for Claude Opus 5 (claude-opus-5) so that malformed arguments never reach its handlers. A reviewer asks what else the setting guarantees about the response, and proposes removing four defensive guards from the handler as redundant. How should you evaluate this proposal?

    Right. In the game that’s Renown for your Tool Design, MCP and Server Tools building.

    Not that one: C is right. In the game your Tool Design, MCP and Server Tools building would lose a little Renown, and this question would come back later.

  2. Your healthcare platform runs Claude Opus 5 (claude-opus-5) under a HIPAA arrangement and sets strict: true on its tools. A proposed schema places patient identifiers in an enum of permitted record keys and encodes a member-number format in a pattern. A privacy reviewer asks whether this design is acceptable. How should you evaluate this proposal?

    Right. In the game that’s Renown for your Tool Design, MCP and Server Tools building.

    Not that one: D is right. In the game your Tool Design, MCP and Server Tools building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Schemas are compiled into grammars and cached for up to 24 hours separately from message content, and those cached schemas do not receive the same PHI protections as prompts and responses.

    Written from platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use

  3. Your platform on Claude Opus 5 (claude-opus-5) defers 900 tool definitions behind a tool search tool, and every tool sets strict: true. Your team wants a prompt cache that survives mid-conversation discovery and proposes dropping strict mode, on the grounds that grammars are recompiled each time Claude surfaces a new tool. How should you evaluate this proposal?

    Right. In the game that’s Renown for your Tool Design, MCP and Server Tools building.

    Not that one: D is right. In the game your Tool Design, MCP and Server Tools building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The strict-mode grammar is built from the full declared toolset rather than from the subset currently in context, so defer_loading and strict mode compose with no recompilation on discovery.

    Written from platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool