Home › Agentic AI with Bunty › Lesson 3

Tools: Bunty's hands

Agentic AI with Bunty, lesson 3 of 6. simple English notes, free.

Open the interactive lesson

The idea

Raj asked Bunty for today's weather. Bunty said: "Sir, I don't even have a window!"

An AI model has a fast brain but no hands. On its own it can't see or touch the world.

Tools are the agent's hands: a weather app, a browser, email, a calendar, a calculator.

The code: Tools are Python functions

Save this as bunty_tools.py and run it with python bunty_tools.py:

# The LLM thinks, tools act. Here the "tools" are plain Python functions Bunty can call.
def weather(city):                   # pretend weather API
    data = {"Patna": 80, "Delhi": 10}
    return data.get(city, 0)

def bill(chai, samosa):             # pretend billing tool
    return chai * 10 + samosa * 15

TOOLS = {"weather": weather, "bill": bill}

def bunty(question):
    if "rain" in question:           # Bunty decides WHICH tool to use
        chance = TOOLS["weather"]("Patna")
        return f"Sir, {chance}% chance of rain. Take an umbrella!" if chance > 50 else "Sir, no rain."
    if "bill" in question:
        return f"Sir, the bill is Rs {TOOLS['bill'](3, 2)}."
    return "Sir, I don't have a tool for that."

print(bunty("Will it rain in Patna tomorrow?"))
print(bunty("What is the bill for 3 chai and 2 samose?"))
print(bunty("Book my Goa trip"))

Output:

Sir, 80% chance of rain. Take an umbrella!
Sir, the bill is Rs 60.
Sir, I don't have a tool for that.

Each tool is a plain function. Bunty decides which tool fits the question, calls it, and answers from the result. No tool, no answer.

Try it: change the code

Try it yourself

Remember

The LLM thinks; tools let it act.

← Goal: tell Bunty what "done" looks like · The agent loop: think, act, check →

All lessons: Agentic AI with Bunty