Part VI: Agentic AI

Chapter 23: Tool Use, Function Calling & Protocols

"Give me a lever long enough and a fulcrum on which to place it, and I shall move the world."

Pip Pip, Archimedes-Quoting AI Agent

Chapter Overview

Agents become truly useful when they can interact with external systems: calling APIs, querying databases, executing code, and browsing the web. This chapter covers the mechanisms that enable tool use, from provider-specific function calling APIs (OpenAI, Anthropic, Google) to standardized protocols like MCP (Model Context Protocol) and A2A (Agent-to-Agent Protocol).

You will learn to design tool schemas with proper parameter validation, build and deploy MCP servers that expose tools and resources to LLM-powered agents, implement inter-agent communication using A2A Agent Cards and task lifecycle management, and combine retrieval-augmented generation with agentic tool use for knowledge-grounded agents. The chapter emphasizes production-quality tool design with input validation, error handling, rate limiting, and security controls.

Big Picture

Agents become truly powerful when they can call external tools: APIs, databases, code interpreters, and more. This chapter covers function calling, tool protocols like MCP, and structured output formats that enable reliable tool use. These capabilities are prerequisites for the specialized and multi-agent systems in Chapters 24 and 25.

Learning Objectives

Prerequisites

Sections

What's Next?

In the next chapter, Chapter 24: Multi-Agent Systems, we explore how to coordinate multiple specialized agents to tackle complex tasks.