Simulate EVM Transaction
evm_simulate_transactionSimulate read-only smart contract calls on any EVM network to test functions and get decoded results or revert reasons.
Instructions
Execute a read-only call against an EVM node using Foundry cast and return decoded results or revert reasons.
This tool does NOT submit a real transaction; it simulates via eth_call.
Args:
target (string): Target contract address (0x-prefixed, 42 chars)
signature (string): Function signature, e.g. "balanceOf(address)"
args (string, optional): Space-separated arguments for the function call
rpcUrl (string): JSON-RPC endpoint URL (e.g. http://localhost:8545)
Returns: { "success": boolean, "returnData": string, // Hex-encoded return data (on success) "revertReason": string, // Decoded revert string (on failure) "error": string // Raw error message (on execution failure) }
Examples:
"Check the balance of 0xabc..." → target=contract, signature="balanceOf(address)", args="0xabc..."
"Call the owner() function" → target=contract, signature="owner()", rpcUrl="http://localhost:8545"
Error Handling:
Returns { success: false, revertReason } if the call reverts
Returns { success: false, error } if cast is not installed or RPC is unreachable
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Space-separated arguments for the function call | |
| rpcUrl | Yes | JSON-RPC endpoint URL | |
| target | Yes | Target contract address (0x-prefixed, 42 chars) | |
| signature | Yes | Function signature, e.g. 'balanceOf(address)' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| success | Yes | ||
| returnData | No | ||
| revertReason | No |