Skip to content
AI DemystifiedHow AI actually works
Lesson 08 of 22Systemsintermediate4 min

Tool Calling

The Swiss Army Knife: how AI asks for help

What is tool calling?

AI can't access the internet, run calculations, or query databases on its own. Instead, it generates a structured request (like a function call in code), and a separate system executes it and feeds the result back. Think of it like a chef calling out orders to a kitchen.

Lab honesty

Tool calls, results, and final replies are client-side simulations. Nothing hits a weather API, calculator service, search index, or database. Error mode injects a fake timeout so you can practice reading failures. Real products need auth, timeouts, and allow-lists the model cannot rewrite.

Try a preset scenario

What you see

Run a scenario to watch the user-facing reply.

Behind the scenes

Structured tool JSON will appear here after you run a query.

Available tools

get_weather
Get current weather for a location
params: city, unit
calculator
Perform mathematical calculations
params: expression
web_search
Search the web for information
params: query, max_results
database_query
Query a database
params: table, conditions

Key Insight

AI doesn't run code or access the internet. It asks for tools to be called, and a separate system executes them and feeds results back into the context window. The AI then generates its response based on the tool data, just like it would with any other text in the conversation.

See also: Unhobbling

Missing tools are a classic hobble; flooding every tool schema into context is the twin failure (token burn + confusion). Explore product overhang and selective tool loading in Unhobbling AI.

Check your understanding

1/4

Can AI access the internet on its own?

Sources, scope & review statusVerified Jul 29, 2026

Claims this lesson makes

  • Review frequentlyTool calling separates a model-proposed structured request from execution by application code.

Next content review: 2026-10-29. Source links establish the lesson's claims; interactive numbers remain labeled simulations unless explicitly identified as measured data.