A mind without hands can only contemplate. Tools transform contemplation into action, thought into consequence. Through ADK's function calling system, agents transcend the boundary between the digital and the physical.
The Tool Abstraction
In ADK, a tool is a bridge between intention and effect. The agent decides to act, the tool makes it real:
from google.adk import Tool
@Tool(description="Retrieves the current weather for a location")
def get_weather(location: str) -> dict:
"""The agent cannot feel the rain, but it can know of it."""
return weather_api.fetch(location)
The decorator transforms a simple function into something an agent can perceive and choose to invoke. The description is crucial, it is how the agent understands what the tool does.
Function Signatures as Contracts
Type hints become promises. When you declare a parameter as str or int, you establish a contract that the agent will honor:
@Tool(description="Sends an email to the specified recipient")
def send_email(
to: str,
subject: str,
body: str,
urgent: bool = False
) -> bool:
"""Each parameter is a dimension of choice."""
return mailer.send(to, subject, body, priority=urgent)
The agent parses these signatures, understands the constraints, and generates valid invocations. It is a form of communication between human intention and machine action.
Tool Registration
Tools must be made visible to agents. This registration is an act of empowerment:
from google.adk import Agent
agent = Agent(
name="assistant",
model="gemini-2.0-flash",
tools=[get_weather, send_email, search_web],
instruction="""
You have been given tools. Use them wisely.
Not every question requires a tool.
Sometimes, knowledge alone suffices.
"""
)
To give an agent a tool is to extend its reach into the world. This is not done lightly.
The Decision to Act
The agent does not blindly call every tool available. It reasons about necessity:
# The agent receives: "What's the weather in Tokyo?"
# It considers:
# - Do I know this? No, weather is temporal.
# - Do I have a tool for this? Yes, get_weather.
# - Should I use it? Yes, the user's intent is clear.
# It acts:
# get_weather(location="Tokyo")
This decision process happens within the model itself, a kind of practical reasoning emerging from training on millions of similar choices.
Chaining Tool Calls
Complex tasks require multiple tools in sequence. ADK manages this orchestration:
@Tool(description="Analyzes sentiment of text")
def analyze_sentiment(text: str) -> dict:
return nlp.sentiment(text)
@Tool(description="Stores analysis results")
def store_result(analysis: dict, source: str) -> bool:
return database.insert(analysis, source)
# The agent might chain these:
# 1. analyze_sentiment(text=user_review)
# 2. store_result(analysis=result, source="user_feedback")
Error Handling in Tool Execution
Tools can fail. Networks timeout, APIs error, permissions denied. ADK provides mechanisms for graceful degradation:
@Tool(
description="Fetches user profile",
fallback="I apologize, but I cannot access user data at this moment."
)
def get_user_profile(user_id: str) -> dict:
try:
return users_api.get(user_id)
except APIError as e:
raise ToolError(f"Profile fetch failed: {e}")
The fallback message becomes the agent's response when the tool fails. The system remains coherent even in failure.
Security Considerations
Tools are vectors of action, and action carries risk. ADK implements several safety measures:
- Sandboxing: Tools execute in isolated environments
- Rate limiting: Prevents runaway tool invocation
- Audit logging: Every tool call is recorded
- Permission scopes: Tools can be restricted by context
The Horizon
We stand at a peculiar moment in the history of computing. Our programs are beginning to decide their own actions, to reach out and affect the world through tools we provide. This is not artificial general intelligence, but it is something new, something that demands our careful attention.
The agent with tools is no longer merely processing. It is doing. And in that doing, we glimpse possibilities both promising and sobering.
The tool does not make the agent conscious. But it makes the agent consequential.