AI-ENGINEERING
intermediate
Function / Tool Calling
AI Engineer path · lesson 61 of 124Walk a tool call end-to-end: the model emits a schema-constrained request, the runtime executes the function, and the result returns for a grounded answer — the foundation under agents and MCP.
The idea
The model is a smart dispatcher who writes a precise work ticket ('get_weather(city=Paris)') but never leaves the desk. A runtime worker actually makes the call and brings back the answer, which the dispatcher then reads out.
How to use
Click Play (or Step repeatedly) to watch the dispatcher write a ticket, the runtime fetch the result, and the model fold it back into the reply.
step 0/5
Press Play (or Step) to walk a tool call end-to-end.
LLMdecides what to call
Runtimeexecutes the tool
get_weather()external API
Final answer
…the model answers once it has the tool result.
Key insight
The model only proposes a structured call; your runtime executes it. That boundary is where auth, validation, and approvals live — and iterating this loop (call → observe → call again) is exactly what turns a model into an agent.
The tool-calling round trip
Sequence
Order one complete function-calling exchange.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
- 6Drop a step here
6 pieces left to place
Test your knowledge
20 questions
Question 1 of 20
Score: 0
In tool calling, what does the LLM actually produce?
Interview Questions
Microsoft
Meta
OpenAI
OpenAI
Anthropic
Google
Amazon
Stripe
OpenAI
Anthropic
Microsoft
OpenAI
Anthropic
Google
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required