Skip to main content
You gave the agent a role, a set of rules, and a voice so it can talk—but it still couldn’t act. Try asking it where order A1001 is. The model has never seen your live orders, so it has exactly two honest options: admit it can’t check the order, or guess. A confident, polished guess in perfect customer-service English is exactly what makes support bots dangerous.
Today we change that. You hand the agent its first set of tools. One hard rule sits underneath everything: a language model can only produce text. Its knowledge froze the day its training finished, and it can’t touch your database, a calculator, or the internet. A tool fixes that — it is a callable function the agent can use to do things the model cannot do alone: check live data, run a calculation, or call an external API.
A dark infographic titled "What a Tool Is" showing a text-only model (frozen at training) sending output to a tool icon. The tool then branches to examples like "Your database," "A calculator," and "The internet."
In ADK, a tool is just a plain Python function. Below are two simple examples: one to look up an order and another to return the store’s hours.
Why this shape matters:
  • Consistent return format: each tool returns a dictionary with a status field rather than a freeform string. That lets the agent distinguish success, failure, and other states programmatically.
  • Schema from docstrings + signature: ADK builds the tool schema from the function signature and the docstring only. The model never sees your function body—only the name, parameter types, and the docstring are used to describe the tool.
  • Type hints are important. order_id: str tells the model the argument should be text and reduces argument-format errors when the agent calls the tool.
Write docstrings as if you’re explaining the function to a novice. The docstring is the only description the model will ever read.
How tools are wired into an agent
  • When you create the agent, pass the function objects (not their return values) to the LlmAgent constructor via the tools field.
  • The system prompt passed to the model is adjusted to list the available tools and their schemas, but the model still decides whether and when to call them.
  • The agent uses a think-act-observe loop when it needs external data.
Four-step think-act-observe loop
  1. Reason: the model reads the user message and the available tool schemas and decides whether a tool is needed.
  2. Call the tool: the model emits a structured request naming the tool and its arguments (for example, get_order_status with order_id="A1001"). ADK catches that request and runs your real function.
  3. Observe: ADK sends the actual return value from your function back to the model as an observation.
  4. Respond: the model reads the observation and either calls another tool or writes the final answer.
This same think-act-observe-repeat loop can run multiple times during one user interaction.
A schematic titled "Four Steps" showing four labeled boxes (1 Reasons, 2 Calls the tool, 3 Observes, 4 Responds) connected by arrows. Below it is a workflow diagram showing interactions between "You," "The model," "ADK," and "Your function" with bidirectional arrows.
Example multi-tool run
  • User: “Where’s order A1001? Open on Sunday?”
  • Agent decides both tools are required: first to check the order, then to check hours.
  • Console output example:
What this enables (and what still needs work)
  • Today, two of the most common inbox questions—“Where’s my order?” and “What are your working hours?”—can return real, live answers from lookups.
  • Other flows still need more tooling and safeguards: “Why was I charged twice?” requires an invoice lookup and reconciliation tool; “Cancel my order” needs a safe cancellation flow that can pause for human approval and audit.
Design and safety reminders
Avoid exposing sensitive data through tools. Design tool outputs to provide only the fields needed for the agent’s reply, and ensure destructive operations require explicit human approval.
Step back: many automation problems are best solved by multiple agents and a routing layer. As agents and tools proliferate, you’ll organize them into a graph where specialized agents call each other and share tools safely. Links and references

Watch Video

Practice Lab