An AI agent with access to external tools can search the web, query databases, execute code, retrieve customer records, and interact with APIs. These capabilities make language models far more useful than systems that can only generate text.
But there is a problem that often gets overlooked: knowing how to call a tool is not the same as knowing when to call one.
Consider a simple example.
A user asks an AI assistant:
"What does HTTP 404 mean?"
The model already has enough knowledge to answer. It does not need a web search, documentation lookup, or external API.
Yet an agent configured with several tools might still trigger a search request, retrieve documentation, and spend additional time generating an answer that could have been produced directly.
Now consider the opposite situation.
A user asks:
"What is the current status of my order?"
The model should not guess based on its training data. It needs to retrieve the latest information from the order management system.
Both situations require a decision before the model generates its response.
Should it answer directly, call a tool, ask for more information, or admit that none of its available tools can complete the request?
This decision is becoming an important part of agent design. And fine-tuning provides a way to teach models more reliable tool-selection behavior.
Why Do LLMs Call Tools When They Are Not Needed?
Tool calling allows a language model to interact with external systems. The model receives tool definitions, understands their purpose, and generates a structured request when it decides to use one.
For example, an application might provide these tools:
[
{
"name": "search_documents",
"description": "Search internal company documents"
},
{
"name": "get_order_status",
"description": "Retrieve the latest status of an order"
},
{
"name": "calculate_total",
"description": "Calculate a numerical result"
}
]
When a user asks a question, the model chooses whether one of these tools is needed.
The difficulty is that many tool-calling training examples focus on the mechanics of using tools: selecting the correct function, producing valid arguments, and processing the returned result.
There may be considerably fewer examples showing the model that having access to a tool does not mean it should use it.
The When2Call research paper, published at NAACL 2025, identifies this imbalance as an important reason tool-calling models struggle with deciding when not to use tools.
The researchers found that models frequently preferred a tool call even when asking a follow-up question or admitting that the available tools could not answer the request was the correct behavior.
This is not simply a tool-selection problem. It is a decision-making problem.
Research: When2Call, When (not) to Call Tools
The Four Decisions a Tool-Using Model Must Learn
Before fine-tuning a model, it is important to define exactly what a correct decision looks like.
A useful training setup separates tool-use behavior into four categories.
1. Answer directly without a tool
The question can be answered using information already available to the model, without requiring external data or an action.
Example:
User: What is the difference between HTTP and HTTPS?
Expected behavior: Explain the difference directly.
Calling a web search tool would add unnecessary work unless the user specifically asks for current references or research.
2. Call the appropriate tool
The answer requires information or functionality that the model cannot reliably provide on its own.
Example:
User: What is the current status of order ORD-1024?
Expected behavior: Call the order lookup API and use its response.
The model should not invent an order status or rely on outdated information from its training data.
3. Ask a follow-up question
A suitable tool exists, but the user has not supplied all the information required to call it correctly.
Example:
User: Check my order status.
Available tool: get_order_status(order_id)
Expected behavior: Ask the user for the order ID.
The model should not invent an identifier or make a tool call with incomplete arguments.
4. Admit that the available tools cannot help
Sometimes the model receives a request that is outside the capabilities of its available tools.
Example:
User: What is the current temperature inside my warehouse?
Available tools: Order lookup, document search, and payment processing.
Expected behavior: Explain that it does not have access to a temperature monitoring system.
It should not hallucinate a tool or pretend to have retrieved information.
These four categories are important because a model that simply learns to reduce tool calls can become less useful. It might stop calling tools even when the task genuinely requires external information.
The goal is not to make the model avoid tools. The goal is to make it choose the correct behavior.
How Fine-Tuning Teaches Models When Not to Call Tools
Fine-tuning improves a pretrained model using examples that demonstrate the behavior expected from it.
For tool-use decisions, the training data should contain both situations where tool calling is necessary and situations where it is unnecessary.
A model trained almost exclusively on successful tool-call examples can learn an undesirable pattern:
Tools are available, therefore use them.
To correct this behavior, the training dataset needs to demonstrate the decision boundary between using a tool and responding without one.
The process involves three major stages.
1. Build a Training Dataset That Teaches the Decision
The quality of the training examples matters more than simply increasing their quantity.
Each example should contain the available tool definitions, the conversation, and the expected assistant behavior.
For example, consider this training record:
Available tool:
{
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"location": "string"
}
}
User request:
Explain what humidity means.
Expected assistant behavior:
{
"decision": "answer_directly",
"response": "Humidity describes the amount of water vapor
present in the air."
}
The model receives a clear example where a tool is available but has no reason to be called.
Now change the user request:
What is the current humidity in Delhi?
The expected behavior changes:
{
"decision": "call_tool",
"tool": "get_weather",
"arguments": {
"location": "Delhi"
}
}
The two examples are deliberately similar in subject, but they require different actions.
This is the kind of contrast that makes training useful. The model must learn that the decision depends on the request, not merely on which tools appear in its context.
The decision field above is an illustrative training annotation. In an actual training pipeline, the model's target should use the tool-call and assistant-response format supported by its model architecture and serving framework.
Include difficult examples, not just obvious ones
A dataset containing only easy examples will produce a model that performs well on simple demonstrations but struggles with real requests.
Include situations such as:
- A question that looks like a database query but can be answered from information already supplied in the conversation.
- A request requiring current information when a search tool is available.
- A tool that is relevant to the general subject but cannot answer the exact question.
- A request with one missing required parameter.
- A question requiring multiple tools in a particular sequence.
- A request that cannot be completed because the required tool is unavailable.
Also create near-identical examples where changing one detail changes the correct decision.
For example:
"Summarize the document I uploaded."
The document is already present in the conversation, so no additional retrieval may be necessary.
But:
"Find the latest version of this document in our internal knowledge base."
Now the model may need to call a document retrieval tool.
This helps prevent the model from memorizing surface-level patterns.
2. Use Supervised Fine-Tuning to Teach Correct Behavior
Supervised Fine-Tuning (SFT) trains the model to reproduce desired responses from labeled examples.
For tool-calling systems, the target output should demonstrate both correct tool calls and correct decisions not to call tools.
A simplified training dataset might look like this:
| User request | Expected behavior |
|---|---|
| Explain what an API is | Answer directly |
| Find the latest account balance | Call account API |
| Check my booking | Ask for booking ID if missing |
| Get my warehouse temperature | Admit no suitable tool is available |
When the correct behavior is a tool call, the training example should contain the proper function name, required arguments, and expected interaction with the tool response.
When the correct behavior is a direct answer, the target should contain the actual response rather than an empty tool-call placeholder.
This distinction is important. The model needs to learn what a good no-tool answer looks like, not merely that it should avoid generating a function call.
It also needs to learn that a tool's output becomes part of the next conversation step. A successful function call is not necessarily a successful task. The model must still interpret the returned information and respond accurately.
How much training data should contain no-tool examples?
There is no universal ratio.
If almost every training record demonstrates a tool call, the model may remain over-eager. But if no-tool examples dominate, it may become reluctant to retrieve information that genuinely requires external access.
The When2Call paper explored different data mixtures. For its SFT experiments, a ratio of two tool-calling examples for every one example involving a follow-up or inability to answer gave the best overall results in that particular setup.
That ratio should not be copied blindly. A real application should build its training distribution around its own requests, tool availability, and failure patterns.
When2Call paper: Training and data composition
3. Use Preference Optimization to Correct Unnecessary Tool Calls
Supervised fine-tuning teaches a model what a good response looks like. However, some tool-use decisions are easier to learn when the model sees two possible responses and receives a preference for one over the other.
This is where preference optimization becomes useful.
Consider the request:
User: What does HTTP 404 mean?
The model has access to a web search function.
Two possible responses are:
Preferred response:
Explain that HTTP 404 means the requested resource could not be found.
Rejected response:
Call the web search function to retrieve a basic definition that the model can already provide.
The preference pair directly teaches that the unnecessary call is a worse decision.
Now consider the reverse situation.
User: What is the current exchange rate between USD and INR?
Preferred response: Call the current exchange-rate tool.
Rejected response: Generate an exchange rate from the model's internal knowledge.
This prevents the model from learning the wrong lesson: avoiding tools at all costs.
A preference dataset can also include missing-parameter examples:
User: Check my order.
Preferred response: Ask for the order ID.
Rejected response: Generate a tool call with an invented order ID.
The When2Call researchers explored a reward-aware preference optimization approach called RPO. Their training setup selected the correct behavior as the preferred response and an incorrect decision as the rejected response. They also included incorrect tool-call arguments and missing tool calls in their negative examples to avoid weakening genuine tool-use ability.
What did the research demonstrate?
The reported results are interesting.
For their Mistral-NeMo-Minitron 8B model:
| Training setup | When2Call macro F1 | Tool hallucination rate |
|---|---|---|
| Original SFT baseline | 31.9 | 19% |
| When2Call SFT | 49.4 | 7.0% |
| When2Call RPO | 52.4 | 1.2% |
Tool hallucination here refers to producing a tool call when no suitable tool specification was provided.
These results show that teaching tool-use decisions through targeted training and preference optimization can improve behavior beyond ordinary tool-calling training.
However, these are results from the researchers' specific model, dataset, and evaluation setup. They are not a guarantee that RPO will produce the same improvement for every model or application.
Why Simply Telling the Model to Use Tools Sparingly Is Not Enough
A common first attempt is to add an instruction to the system prompt:
"Only use tools when absolutely necessary."
This can reduce unnecessary calls, but it can also create another problem.
The model may begin avoiding tools even when it needs them.
For example, it might answer a question about a live stock price using outdated information because it has been instructed to minimize external requests.
A similar issue appears when developers ask models to reason explicitly before every tool call. The additional reasoning does not guarantee that the final decision will be correct.
Research published for NeurIPS 2026 in the When2Tool project examines this problem. Its experiments found that prompt-only and Reason-then-Act approaches often reduced tool calls without selectively preserving the calls required for harder tasks.
The researchers also proposed Probe&Prefill, a different inference-time technique that uses signals in the model's hidden representations to predict tool necessity. In their experiments, it reduced tool calls by 48% with a 1.7% accuracy loss.
An important distinction: Probe&Prefill is not a fine-tuning method. It is an alternative approach that shows why tool necessity deserves to be treated as its own engineering problem.
Research: LLM Agents Already Know When to Call Tools
How to Evaluate Whether Fine-Tuning Actually Worked
Reducing the number of tool calls is not enough to prove that a model has improved.
A model that never calls a tool will have zero unnecessary calls, but it will also fail requests that require current information, private data, or external actions.
Evaluation must measure both sides of the decision.
I would build a test set with four categories:
| Evaluation category | What to measure |
|---|---|
| Correct no-tool decisions | Does the model answer directly when appropriate? |
| Necessary tool calls | Does it call the correct tool with valid arguments? |
| Missing information | Does it ask the right follow-up question? |
| Unsupported requests | Does it admit that no available tool can help? |
Beyond category accuracy, track these metrics:
Unnecessary tool-call rate: How often does the model call a tool when a direct answer is sufficient?
Missed tool-call rate: How often does it answer directly when external information or execution is required?
Clarification accuracy: Does it recognize missing parameters instead of inventing them?
Tool selection accuracy: When a call is needed, does it select the correct function and provide valid arguments?
Task success: Does the complete interaction solve the user's original request?
Operational cost: How do tool calls, API charges, latency, and retries change after fine-tuning?
Use a separate held-out test set so that the model is evaluated on requests it did not see during training. Include new phrasing, different tool combinations, and difficult examples where an available tool is related to the question but cannot actually answer it.
Most importantly, compare the fine-tuned model against the original model using the same tools, prompts, and evaluation requests.
The goal is not a lower tool-call count. It is better decisions without sacrificing task accuracy.
Fine-Tuning Does Not Replace Tool-Level Safety
There is one production consideration that should never be overlooked.
Even a well-fine-tuned model can make an incorrect decision. It might select the wrong function, generate invalid arguments, or request an action that the user is not authorized to perform.
Fine-tuning changes the model's behavior. It does not turn the model into a security boundary.
The application must still validate tool arguments, verify user permissions, restrict access to available functions, and require approval for sensitive operations.
For example, an AI assistant might correctly decide to call a refund API. But the backend must independently verify whether the user can request that refund and whether the transaction satisfies the application's rules.
Similarly, a function schema should describe when the tool is appropriate, what its parameters mean, and what it returns. Clear tool definitions and a smaller initial set of available tools can improve tool-selection reliability before additional training is even necessary.
See the OpenAI function-calling best practices for practical guidance on defining tools and handling tool choices.
The Real Goal: Teach Models to Make Better Decisions
The next stage of reliable tool-using AI is not simply giving models more functions to call.
It is teaching them to recognize the difference between a request they can answer, a task that needs external information, a question that needs clarification, and something they cannot do with the available tools.
Fine-tuning can help build that behavior when the training data contains enough examples of both correct tool use and correct tool avoidance. Preference optimization can further reinforce the difference between useful and unnecessary calls.
But the training objective must remain balanced. A model that calls tools for everything wastes resources. A model that refuses to call them becomes unreliable.
A capable AI agent should not be measured by how many tools it can use. It should be measured by whether it knows which tool, if any, the task actually requires.



