passdrill
AI & LLM Engineering · AI Agents & Tool Use · Card 026/032 medium

A developer building a form-filling agent with Claude wants Claude, on this one request, to guarantee it calls the single tool named `submit_form` rather than possibly responding with plain text or calling some other tool it also happens to have defined. Which `tool_choice` value on the Claude API achieves this?

  1. `{"type": "auto"}`, which lets Claude decide for itself whether to call any of the provided tools or respond directly, without guaranteeing any particular tool -- or any tool at all -- gets called
  2. `{"type": "none"}`, which prevents Claude from calling any tool whatsoever, forcing a plain-text response instead
  3. `{"type": "any"}`, which forces Claude to call some tool from the ones provided, but leaves Claude free to pick whichever one of those tools it judges best rather than a specific one
  4. `{"type": "tool", "name": "submit_form"}`, which forces Claude to always use that one, specifically named tool on this request
Next card → Shuffle