PaPoo
cover

What is tool choice (auto / required / none)?

Tool choice (often exposed as tool_choice) is the setting that tells an LLM whether it may decide on its own to call a tool, must call a tool, or must not call any tool.

Why it matters

Tool choice lets you control how an assistant interacts with external capabilities like search, databases, calculators, or internal APIs.

You reach for it when you want to:

In practice, this is one of the main levers for making agentic systems predictable.

How it works

Tool choice is usually part of the model request. The client declares which tools are available, then sets a policy for whether the model may use them.

Common modes are:

Under the hood, auto delegates the decision to the model based on the prompt and tool descriptions. required is useful when the assistant should always route through a tool, such as a search or retrieval step. none is the simplest mode: no tool invocation, just text generation.

The exact API shape varies by provider, and some platforms expose additional options or slightly different names. But the core idea is stable: tool choice controls whether tool calling is optional, mandatory, or disabled.

Tiny concrete example

Imagine a weather assistant with one tool: get_weather(city).

A request might look like this conceptually:

{
  "messages": [{"role": "user", "content": "What's the weather in Paris?"}],
  "tools": ["get_weather"],
  "tool_choice": "auto"
}

Common pitfalls / when NOT to use it

In practice, most teams start with auto, then move to required only for workflows that truly need a tool every time.

Related terms

Related terms

同じ著者の記事