Strict Tool Use
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: trueis a field on the tool definition (sibling ofname/description/input_schema), NOT ontool_choice.- Combine
tool_choice: {"type": "any"}+strict: trueto 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
strictundertool_choice; recognising the correct placement is the tested skill. - Pairing with
anyis the canonical "guaranteed valid tool call" answer.
Common gotchas
- Placing
strictontool_choiceis wrong — it belongs on the tool. strictguarantees schema conformance, not that a tool is called; you still needany/toolto force a call — see Tool Choice.
See also
Sources
Referenced by
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.