A team is building a tool-use agent and wants Claude to always invoke a specific tool (a search function) rather than answering from its training knowledge. Which API parameter achieves this most reliably?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — the tool_choice parameter with type: 'tool' and a specific tool name forces Claude to call that exact tool in its response, regardless of whether it could answer from training knowledge. This is the authoritative API-level control for ensuring tool invocation.
Full explanation below image
Full Explanation
The tool_choice parameter with type: 'tool' and a specific tool name forces Claude to call that exact tool in its response, regardless of whether it could answer from training knowledge. This is the authoritative API-level control for ensuring tool invocation. Option B (temperature: 0) affects output determinism, not tool use behavior — it does not force tool calls. Option C (system prompt instruction) is less reliable than the dedicated API parameter; instruction-following can be inconsistent under adversarial inputs or unusual conversation contexts. Option D (single tool in array) doesn't force its use — with tool_choice: 'auto' (the default), Claude can still choose to respond in text even when only one tool is defined.