# tool_choice

A parameter that controls tool use: "auto" (model decides), "none" (no tools), "required" (must call one), or a specific function.

AI developers · Part 03: Tool calling · Card 8 of 10 · Last updated 2026-10-13

## Analogy

Feature flags for tools. Usually "auto", but you can force or forbid them per call.

## Code example

`tool-choice.ts`

```typescript
await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages,
  tools,
  tool_choice: { type: "function", function: { name: "getOrder" } },
});
```

## In an agent

Forcing a tool is handy for the first step of a workflow, like always classifying before routing.

## Questions people ask

### What does tool_choice do?

It controls tool use for one call. auto lets the model decide, none forbids tools, required makes it call at least one, and naming a specific function forces that function. Most calls use auto. The other values are for steps where you already know what must happen.

### When should I force a specific tool?

When a step must always happen, for example classifying every request before routing it, or always running a search before answering. Forcing the tool makes that step predictable and skips a wasted round where the model might answer without it. Use auto again for the steps after.

## Related concepts

- [What a tool is](https://studyvisually.com/learn/tech/ai-developers/tool-calling/what-a-tool-is)
- [Function schema](https://studyvisually.com/learn/tech/ai-developers/tool-calling/function-schema)
- [Tool description](https://studyvisually.com/learn/tech/ai-developers/tool-calling/tool-description)
- [The tool_calls reply](https://studyvisually.com/learn/tech/ai-developers/tool-calling/tool-calls-response)

Web page: https://studyvisually.com/learn/tech/ai-developers/tool-calling/tool-choice
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=tool-choice
