GENERATIVE AI • LESSON 6

Why Do We Need Multiple Tools?

Imagine you build a personal AI assistant. You want it to be able to:

  • Check weather
  • Calculate numbers
  • Search information
  • Send emails

One tool cannot do all of these jobs. So you provide several tools:

                AI Assistant
                      │
       ┌──────────────┼──────────────┐
       ↓              ↓              ↓
 Weather Tool    Calculator      Email Tool
                     Tool
       │              │              │
       ↓              ↓              ↓
 Weather API       Python        Email API

The AI chooses which tool is appropriate.

Simple Example

Suppose we have three tools:

def get_weather(city):
    return f"Weather in {city}: 30°C"


def calculate(a, b):
    return a + b


def send_email(to, message):
    return f"Email sent to {to}"

Now the AI has three capabilities:

get_weather()
calculate()
send_email()

User Asks Different Questions

Question 1

"What's the weather in Hyderabad?"

AI needs:

get_weather()

Flow:

User
  ↓
LLM
  ↓
Weather Tool
  ↓
Weather Result
  ↓
LLM
  ↓
Answer

Question 2

"What is 250 + 450?"

AI needs:

calculate()

Flow:

User
  ↓
LLM
  ↓
Calculator Tool
  ↓
700
  ↓
LLM
  ↓
Answer

Question 3

"Send John an email saying I'll join the meeting."

AI needs:

send_email()

Flow:

User
  ↓
LLM
  ↓
Email Tool
  ↓
Email Service
  ↓
Result
  ↓
LLM
  ↓
Answer

The important thing is:

The AI chooses the tool based on what the user is asking.

The AI Doesn't Use Every Tool

This is important.

Suppose we have:

Tools:

  1. get_weather()
  2. calculate()
  3. send_email()

User asks:

"What's the weather in Hyderabad?"

The AI shouldn't do:

get_weather()
calculate()
send_email()

It should choose:

get_weather()

So:

User Question
      ↓
     LLM
      ↓
Understand request
      ↓
Choose appropriate tool
      ↓
Execute tool
      ↓
Get result
      ↓
Answer

Tool Selection

Think of the LLM as a manager.

You give the manager three workers:

Worker 1 → Weather
Worker 2 → Calculator
Worker 3 → Email

The manager receives:

"Check the weather."

It says:

"Weather worker, handle this."

For:

"Calculate 100 × 50."

It says:

"Calculator worker, handle this."

For:

"Send an email."

It says:

"Email worker, handle this."

The LLM is effectively doing the tool selection.

One User Request Can Require Multiple Tools

This is where things become more interesting.

Suppose the user asks:

"What's the weather in Hyderabad and email the result to John?"

Now we need two tools.

User
  ↓
LLM
  ↓
Weather Tool
  ↓
Weather Result
  ↓
LLM
  ↓
Email Tool
  ↓
Email Sent
  ↓
LLM
  ↓
Final Answer

For example:

Weather:
30°C and sunny

Email:
Sent to John

The AI had to perform two operations.

Multiple tools

            LLM
              ↓
       Choose appropriate tool
        ↙       ↓       ↘
    Weather  Calculator  Email
        ↘       ↓       ↙
             Result
                ↓
               LLM
                ↓
              Answer