Agent Tools
any-agent
provides 2 options to specify what tools
are available to your agent: Callables
and MCP
(Model Context Protocol). In order to support multi-agent systems, any agents served via A2A can also be integrated by wrapping the A2A connection in a callable function tool as described below.
You can use any combination of options within the same agent.
Callables
Any Python callable can be directly passed as tools. You can define them in the same script, import it from an external package, etc.
Under the hood, any-agent
takes care of wrapping the
tool so it becomes usable by the selected framework.
Tip
Check all the built-in callable tools that any-agent provides.
from any_agent import AgentConfig
from any_agent.tools import search_web
main_agent = AgentConfig(
model_id="mistral/mistral-small-latest",
tools=[search_web]
)
MCP
MCP can either be run locally (MCPStdio) or you can connect to an MCP that is running elsewhere (using either MCPSse or MCPStreamableHttp).
Tip
There are tools like SuperGateway providing an easy way to turn a Stdio server into an SSE server.
Warning
The SSE remote transport has been deprecated as of MCP specification version 2025-03-26. Please use the HTTP Stream Transport instead.
See the MCPStdio API Reference.
See the MCPStreamableHttp API Reference.
See the MCPSse API Reference.
Using Agents-As-Tools
To directly use one agent as a tool for another agent, any-agent
provides 3 different approaches:
The agent to be used as a tool can be defined as usual:
from any_agent import AgentConfig, AnyAgent
from any_agent.tools import search_web
google_agent = await AnyAgent.create_async(
"google",
AgentConfig(
name="google_expert",
model_id="mistral/mistral-small-latest",
instructions="Use the available tools to answer questions about the Google ADK",
description="An agent that can answer questions about the Google Agents Development Kit (ADK).",
tools=[search_web]
)
)
You can then choose to wrap the agent using different approaches:
Finally, regardless of the option chosen above, you can pass the agent as a tool to another agent: