evm_estimate_fees
Estimate total transaction cost with EIP-1559 gas breakdown by simulating a transaction on supported EVM chains; returns gas limit, base fee, priority fee, and cost in native token and USD.
Instructions
Estimate total transaction cost with detailed EIP-1559 breakdown.
Simulates transaction to estimate gas usage, then calculates cost using current gas prices. Returns detailed breakdown: gas limit, base fee, priority fee, and total cost in native token and USD.
CRITICAL RULES:
Estimation may differ from actual (contract state changes)
Read-only operation (no gas cost)
Includes safety margin in gas limit
Requires sender to have sufficient balance
Complex contract calls need 'data' parameter
Value must be in ether units
PARAMETERS:
chain: EVM chain to estimate on (required)
Each chain has different gas costs
from: Sender address (required)
Must have balance for value transfer
Format: "0x..." (42 characters)
to: Recipient address (required)
EOA for transfers, contract for calls
Format: "0x..." (42 characters)
value: Amount to send (optional)
In ether units (e.g., "1.5")
Omit for contract calls without value
data: Transaction data (optional)
For contract interactions
Format: "0x..." (hex encoded)
EXAMPLES: ✅ Estimate simple ETH transfer: {chain: "ethereum", from: "0x742d35Cc...", to: "0x8626f6940...", value: "0.1"}
✅ Estimate token transfer cost: {chain: "polygon", from: "0x742d35Cc...", to: "0xTokenContract...", data: "0xa9059cbb..."}
✅ Estimate contract call with value: {chain: "bsc", from: "0x742d35Cc...", to: "0xContract...", value: "1.0", data: "0x12345678..."}
SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559
CRITICAL GAS CONSIDERATIONS:
Ethereum: High gas costs, use gas oracle for timing
Polygon/BSC: Very low gas, safe for frequent transactions
Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum
Avalanche: Dynamic fees, can spike during congestion
Always check gas price before executing transactions
TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.
OUTPUT STRUCTURE: • gasLimit: Estimated gas units required • baseFee: EIP-1559 base fee (wei) • priorityFee: Suggested priority fee (wei) • totalGasCost: Total in native token • totalUSD: Estimated USD cost (if available) • breakdown: Detailed cost components
COMMON MISTAKES:
Not including data for contract interactions
Using wei instead of ether for value
Estimating with insufficient sender balance
Forgetting to add buffer for gas fluctuations
Not re-estimating before actual submission
USE CASES:
Display transaction cost to users before signing
Validate wallet has sufficient balance
Compare costs across different chains
Optimize contract interactions
Budget for transaction fees
Running on Linux.
LINUX-SPECIFIC NOTES:
Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)
Python 3 is typically 'python3' command
GNU tools are standard
Use 'xdg-open' command to open files/applications
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain": "<chain>",
"from": "<from>",
"to": "<to>"
},
"name": "evm_estimate_fees"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient address (0x...) | |
| data | No | Transaction data (optional, 0x...) | |
| from | Yes | Sender address (0x...) | |
| chain | Yes | EVM chain to estimate on | |
| value | No | Amount to send in ether (optional) |