Skip to content

Definition

Setting strict: true on a custom tool definition uses constrained decoding to guarantee that Claude's tool call inputs exactly match the tool's input_schema.

Key points

  • strict: true is a field on the tool definition (sibling of name/description/input_schema), NOT on tool_choice.
  • Combine tool_choice: {"type": "any"} + strict: true to guarantee both that a tool is called AND that its inputs are schema-valid.
  • Constrained-decoding mechanism is the same family as Structured Outputs — the two can be combined.

Why it matters for the exam

  • A classic distractor puts strict under tool_choice; recognising the correct placement is the tested skill.
  • Pairing with any is the canonical "guaranteed valid tool call" answer.

Common gotchas

  • Placing strict on tool_choice is wrong — it belongs on the tool.
  • strict guarantees schema conformance, not that a tool is called; you still need any/tool to force a call — see Tool Choice.

See also

Sources