Code

cookbook/tools/evm_tools.py
from agno.agent import Agent
from agno.tools.evm import EvmTools

agent = Agent(
    instructions=[
        "You are a blockchain assistant that helps with Ethereum transactions",
        "Help users send transactions and interact with smart contracts",
        "Always verify transaction details before executing",
    ],
    tools=[EvmTools()],
    markdown=True,
)

agent.print_response("Check my account balance and estimate gas for sending 0.01 ETH")

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your credentials

export EVM_PRIVATE_KEY=your-private-key
export EVM_RPC_URL=https://your-rpc-endpoint.com
export OPENAI_API_KEY=xxx
3

Install libraries

pip install -U web3 openai agno
4

Run Agent

python cookbook/tools/evm_tools.py