Tools
are externally defined functions or services that an agent can call to extend its capabilities beyond pure language-model reasoning. Tools
allow the agent to perform actions like looking things up on the web, getting the current time, querying APIs, or any arbitrary logic you build. They bridge the gap between what the model “knows” inherently and what it can do: you provide defined interfaces as either Python functions or MCP servers that the agent can use when needed, enabling more accurate, up-to-date, and actionable responses.
Python Functions as Tools
You can build your own custom tools in Python for your agents to call when needed. This feature allows unlimited tool possibilities because you can build a tool to do whatever you’d like.How the Example Works
The example defines a simple Python functioncurrent_iso8601_utc_time()
that returns the current UTC time in ISO-8601 format. That function is wrapped as a Tool, then given to the agent (“Henry”) as part of its configuration. Because the tool is included, the agent can invoke it when asked for the current time.
The setup shows two modes: purely local tools (Python functions) and tools via MCP (Model Context Protocol) servers. For example, “Henry” can use both the current_iso8601_utc_time
Python tool and a web-search tool plugged in via MCP (e.g. McpTool("brave_search", "brave_web_search")
).
The example also shows how to configure the infrastructure: specifying the agent, model, tools list; how to start the node; how to wire up MCP clients so that external tool servers can be used.
You can find all the code for this example on Github.
images/main/main.py
images/main/Dockerfile
autonomy.yaml
Tools provided by MCP Servers
autonomy.yaml
secrets.yaml
images/main/Dockerfile
images/main/main.py