Skip to main content
Glama

evm_get_gas_price

Fetch current gas prices for a specified EVM chain, returning legacy or EIP-1559 fee data so you can estimate transaction costs and set appropriate fees before sending.

Instructions

Get current gas price for optimal transaction pricing on any EVM chain.

Returns current gas pricing information in both legacy format (gasPrice) and EIP-1559 format (baseFeePerGas + maxPriorityFeePerGas) depending on chain support.

CRITICAL RULES:

  • EIP-1559 chains return base fee + priority fee structure

  • Legacy chains return single gasPrice value

  • Gas prices fluctuate constantly (poll frequently for accuracy)

  • Higher gas price = faster confirmation (competitive fee market)

  • Gas price returned in wei (divide by 1e9 for gwei)

PARAMETERS:

  • chain: EVM chain to query gas prices (required)

    • Each chain has different gas price ranges

    • Ethereum: typically highest gas costs

    • L2s (Arbitrum, Base): 10-50x cheaper

    • Sidechains (Polygon, BSC): very low gas costs

EXAMPLES: ✅ Check Ethereum gas price: {chain: "ethereum"}

✅ Compare Polygon fees: {chain: "polygon"}

✅ Get BSC gas price: {chain: "bsc"}

❌ Invalid - typo in chain name: {chain: "etherum"}

❌ Invalid - mainnet name: {chain: "ethereum-mainnet"}

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 (EIP-1559 chains): • success: Boolean indicating operation success • chain: Queried chain identifier • eip1559: Boolean indicating EIP-1559 support • baseFeePerGas: Base fee in wei (burned) • maxPriorityFeePerGas: Suggested tip in wei (to validators) • maxFeePerGas: Maximum total fee willing to pay • gasPrice: Legacy format (baseFee + priorityFee) for compatibility • gasPriceGwei: Human-readable gas price in gwei • executionTime: Time taken in milliseconds

OUTPUT STRUCTURE (Legacy chains): • success: Boolean indicating operation success • chain: Queried chain identifier • eip1559: false • gasPrice: Current gas price in wei • gasPriceGwei: Human-readable gas price in gwei • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Using stale gas prices (should poll before each transaction)

  • Not converting wei to gwei for display

  • Assuming same gas costs across all chains

  • Setting gas price too low (transaction may not confirm)

  • Forgetting gas price spikes during network congestion

USE CASES:

  • Determine optimal transaction timing

  • Calculate transaction cost estimates

  • Monitor network congestion via gas prices

  • Compare chain costs for multi-chain applications

  • Set appropriate gas limits for transactions

GAS PRICE STRATEGIES:

  • Standard: Use returned maxFeePerGas (normal confirmation)

  • Fast: Multiply maxPriorityFeePerGas by 1.2-1.5 (faster confirmation)

  • Slow: Use minimum maxPriorityFeePerGas (slower but cheaper)

  • Instant: Multiply maxPriorityFeePerGas by 2+ (next block)

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>"
    },
    "name": "evm_get_gas_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden, and it does well on output shape, wei vs gwei units, EIP-1559 vs legacy branching, and testnet-only value. However, it never states that the call is read-only and requires no auth, and the surrounding sections (Linux notes, faucets, gas strategies) mix in noise that dilutes the behavioral signal.

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 key purpose is front-loaded, but the body is severely bloated with redundant sections: two full output-structure blocks, examples, supported chains, common mistakes, use cases, gas strategies, and irrelevant Linux package-manager notes. Much of this restates or exceeds what an agent needs to invoke a one-parameter read.

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 one-parameter query with no output schema, the definition is thorough: it enumerates return fields for both EIP-1559 and legacy chains and warns about wei/gwei conversion and volatility. It lacks explicit sibling differentiation but is otherwise complete enough to call correctly.

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

Parameters3/5

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

Schema coverage is 100% with an enum, so the schema already documents the single required chain parameter. The description adds contextual meaning by explaining relative cost profiles per chain (Ethereum highest, L2s 10-50x cheaper), which is a genuine addition beyond the enum, but it also blurs the testnet nature (enum values are Sepolia/Amoy while prose names look like mainnets).

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?

States a specific verb and resource: 'Get current gas price ... on any EVM chain', and distinguishes the legacy vs EIP-1559 return shapes. It does not differentiate itself from close siblings like evm_get_gas_oracle or evm_get_base_fee, so an agent still has to infer which to call.

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?

Provides many use cases and even a 'use gas oracle for timing' aside, but never explicitly states when to prefer this over evm_get_gas_oracle, evm_get_base_fee, evm_get_fee_history, or evm_estimate_gas. Usage is implied rather than staked out against alternatives.

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