From the course: Hands-On AI: Building Agents with the Google Agent Development Toolkit (ADK)

ADK's built-in toolbox: Essential capabilities for your agents

- [Instructor] What's the real difference between a basic chatbot and a truly helpful AI assistant? Often, it's the ability to do things, to interact with the world and perform actions. In ADK, tools are what elevate your agents, transforming them from simple text responders into powerful real-world problem solvers that can fetch live data or even execute code. Tools represent specific capabilities provided to an AI agent, enabling it to perform actions and interact with the world beyond its own reasoning. A tool can be almost anything. A function that performs a calculation, a connection to a database, a web search, or a code executor. Tools empower agents to do more than just generate text. They allow agents to fetch up-to-date information, run code, or interact with external systems. ADK offers various tool types, but built-in tools are your starting point for common essential tasks. These are pre-packaged capabilities that give your agents immediate access to powerful functionalities without extensive custom coding. Think of tools like google_search, which allows agents to perform web searches for the very latest information, or built_in_code_execution, enabling agents to dynamically run Python code snippets, and VertexAiSearchTool, which facilitates advanced retrieval augmented generation, or RAG, by querying your data in Vertex AI Search. So how do you actually give an agent a tool? It's actually quite straightforward. First, you import the tool. For our example, that's from google.adk.tools import google_search. Then, when you're defining your agent, like our latest events agent, you simply pass the imported tool object to its tools parameter like this, tools=[google_search]. But the real magic as always with LLM agents happens in the instruction. For our latest events agent, the instruction is very detailed, guiding exactly how it should behave. It says, "You are a highly helpful and detailed travel assistant. When a user asks about events, number 1, identify key information. Number 2, use Google search. Utilize the Google search tool to find relevant, current or upcoming events, followed by summarize and structure where you present each event as a main item in a markdown unordered list. Each event entry must follow this exact markdown structure." This precise prompt ensures our agent not only uses Google search, but also processes and formats the results exactly how we want. So, when a user asks what food festivals are happening in London next month, the agent follows these steps, uses the search tool to get live event data and present it in that clean markdown format you see in the notebook output. Now, while these built-in tools are incredibly powerful, there are a few key considerations you keep in mind. First, an agent can typically only use one built-in tool at a time. You can't usually assign both Google search and built-in code execution directly to the same agent. Second, built-in tools are primarily optimized for and work best with Gemini models. And third, there might be limitations on using built-in tools directly within subagents of a workflow. A parent agent using a tool can of course pass results down. It's always a good idea to check the latest ADK documentation for any updates on these points as the framework is constantly evolving. Beyond these built-in options, ADK has a broader tool ecosystem. Later, we'll cover function tools, which are custom Python functions you define, and also third-party tool integrations. And for managing collections of these other tool types, ADK introduces tool sets, allowing dynamic tool selection. Just remember that one built-in tool rule per active agent we discussed. ADK has built-in toolbox, especially with versatile tools like Google search, provides a fantastic foundation for creating agents that are dynamic and deeply connected to real-world information. As you saw with our latest events agent, clear instructions combined with the right tool empower your agent to deliver truly useful and timely responses. This modular approach is absolutely key to building capable and production-ready AI systems.

Contents