Section 4: Tool Calling, Actions and MCP
Tool calling is what separates an agent from a chatbot. When an LLM calls a tool, it generates a structured request to invoke an external function, and your system executes it. Without tool calling, the LLM is limited to what it memorized during training. With tool calling, it can look up live data, process payments, query databases, and modify real systems.
This section covers how function calling works mechanically, how to design tool schemas that the LLM can use reliably, how to handle errors when tools fail, how to optimize with parallel execution, and how the Model Context Protocol (MCP) standardizes tool integration.
What We’ll Cover
Connection to the Agent Loop
In the Perceive, Reason, Act, Observe loop from Section 1, tool calling IS the “Act” step. The LLM reasons about what tool to call (Reason), generates the structured call (Act), your system executes it and returns the result (Observe), and the LLM reasons about the result before deciding the next step. Everything in this section teaches you how to build and control that “Act” step.