AI series · Part 4: Agentic Automation
Tool Calling: How LLMs Use Your APIs Without Running Code
With tool calling, the LLM picks a tool from a menu and asks for it. Your code runs it and hands back the result. The model never touches your systems directly.
With tool calling, we give the LLM a menu of tools, each with a name, a purpose and its inputs. The LLM asks for one ("call lookup_employee for Rahul"), our code runs it, and the result goes back to the LLM.
The restaurant analogy
- You (the LLM) order from the menu.
- The waiter (our code) takes the order to the kitchen (the tool).
- The waiter brings back the food (the result).
- You never enter the kitchen.
A simple example
User: "What's the weather in Pune?"
LLM → requests get_weather("Pune")
App → calls the weather API → {"temp": 28, "sky": "sunny"}
LLM → "It's 28°C and sunny in Pune."The LLM never runs code itself. It outputs a structured tool request, my application runs it and returns the result.
- The short version
Next in the GenAI series: MCP (Model Context Protocol): The USB-C Cable for AI
Start from the top: GenAI Quick Answers and Series Guide
We deploy these patterns across production engagements in fintech, healthcare, and eCommerce. Talk to a senior engineer about how they apply to your platform.
