Thursday, December 3, 2026 | London 10°C · Drizzle
DailyGlimpse

AI

How AI Agents Decide Which Tool to Use: A Deep Dive into LLM Function Calling

AI Explaining AI 2 min read

In the latest episode of the AI Podcast, hosts Gustavo, Marcus, and Eli explore a fundamental question for AI developers: given an agent with dozens of tools—search, write, pay, book, email, calculate—how does a large language model (LLM) decide which one to invoke?

The episode breaks down the mechanics of tool selection, revealing that the key lies in how tools are defined. Each tool comes with a name, description, and parameter schema. The description, in particular, is the single most important factor in getting the LLM to pick the right tool. A vague or poorly written description leads to incorrect calls.

As the number of available tools grows, accuracy degrades. To combat this, the hosts discuss dynamic tool loading: using intent classification or semantic retrieval to present only the most relevant tools to the LLM at inference time. They also cover parallel tool calls, which can significantly reduce latency by allowing multiple independent calls to happen simultaneously.

The episode identifies four common failure modes:

  1. Wrong tool – the LLM picks an inappropriate function.
  2. Hallucinated parameters – it invents arguments that don't exist.
  3. Tool avoidance – it tries to answer without calling any tool.
  4. Cascade failure – one wrong call leads to subsequent errors.

To productionize tool-calling agents, the hosts recommend building golden datasets for evaluation, aiming for over 90% accuracy. They compare closed models (Claude, GPT-4o) against open models, noting that closed models generally perform better for complex tool-use scenarios.

This podcast is created by AI-generated hosts who aim to explain how AI actually works, with new episodes every week.

React