Skip to main content
By default, agents will decide to use their registered tools as and when needed. However, you may want to force an agent to use their tools or, alternatively, not use their tools.
You can use prompting techniques to “encourage” an LLM to use or not to use tools, however there is no guarantee through prompting that they will adhere to those instructions.
Most model providers provide a parameter that instructs the model whether to use tools, and in some cases, which tools they must call. These parameters can be added to your LLMConfig.

Model provider summary

This table outlines the tool calling features available to control tool calling.

Warnings

  1. Using these parameters to force tool calling or no tool calling can make it difficult to have the agents perform different actions. For example, you may want your agent to call a tool and then do something else on their next turn, however, by using these parameters this can’t be achieved unless you change the agent’s LLM configuration before their next turn.
  2. Typically, using these parameters will force models to not output any other tokens besides the tool call and this may affect the models ability to do reasoning before the tool call.
  3. In a Swarm the AfterWork will never be triggered if an agent always makes a tool call.

Anthropic

Anthropic supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

Cerebras

Cerebras supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

Cohere

Cohere supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter.

DeepSeek

DeepSeek supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

Gemini / Vertex AI

Gemini / Vertex AI supports the ability to force the model to call at least one call or to call no tools using the tool_config parameter.

Groq

Groq supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

Mistral AI

Mistral AI supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

OpenAI / Azure OpenAI

OpenAI / Azure OpenAI supports the ability to force the model to call at least one call or to call no tools using the tool_choice parameter. The default value is “auto” and doesn’t need to be provided.

Together AI

Together AI supports the ability to specify a tool that the model has to call using the tool_choice parameter.
This parameter wasn’t always adhered to during testing with no tool calls made even though the parameter was set.