Skip to main content
Glama

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

NameRequiredDescriptionDefault
toYesRecipient address (0x...)
dataNoTransaction data (optional, 0x...)
fromYesSender address (0x...)
chainYesEVM chain to estimate on
valueNoAmount to send in ether (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does so well: it states the operation is read-only/free, that estimates can diverge from actual cost due to state changes, that a safety margin is baked into the gas limit, and that the sender needs sufficient balance. It also enumerates the return shape (gasLimit, baseFee, priorityFee, totalGasCost, totalUSD, breakdown) and flags that all chains are testnets with no real value. Missing only cost/nonce override behavior and rate-limit expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-line purpose and the output structure are front-loaded and useful, but the body sprawls into per-chain marketing blurbs, gas-cost advisory, faucet notes, a common-mistakes list, and a use-case list that mostly restate each other. Worst of all, it ends with an entirely off-task 'Running on Linux / LINUX-SPECIFIC NOTES' block about apt, yum, and xdg-open that has nothing to do with fee estimation and reads as injected noise, diluting the signal an agent needs to act on.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter, no-output-schema estimation tool, the description covers what an agent needs: the simulation mechanism, required balance, unit conventions, supported networks, and an explicit return-field breakdown. The off-topic trailing section and the absence of any statement about accuracy bounds or caching are the only real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description adds genuine meaning on top — value is in ether not wei, 'data' is required for complex contract calls, 'to' is an EOA for transfers vs a contract for calls, and examples show exactly which combination of fields each scenario needs. Chain-specific notes ('each chain has different gas costs' plus per-network fee characteristics) add context the enum alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource ('Estimate total transaction cost') and clarifies the mechanism: simulate gas usage, then price it with current gas prices. It is clearly distinct in spirit from gas-only estimation, but it never names the closest sibling evm_estimate_gas or evm_estimate_bridge_fee, so an agent must infer the boundary itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'USE CASES' block implies when to reach for it (pre-signing cost display, balance validation, cross-chain comparison), which gives usable context. However, there are no when-not conditions and no routing to alternatives such as evm_estimate_gas for gas units alone or evm_estimate_bridge_fee for bridging, and the use cases are generic rather than discriminating.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools