Skip to main content
Glama

estimate_gas

Calculate the gas cost for Ethereum-compatible blockchain transactions by providing recipient address, network, and transaction data. Integrates with EVM MCP Server for accurate estimations.

Instructions

Estimate the gas cost for a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoThe transaction data as a hex string
networkNoNetwork name or chain ID. Defaults to Ethereum mainnet.
toYesThe recipient address
valueNoThe amount of ETH to send in ether (e.g., '0.1')

Implementation Reference

  • Helper function implementing gas estimation for transactions using the viem client. This is the core logic for estimating gas, likely used by MCP tool handlers.
    export async function estimateGas(params: EstimateGasParameters, network = 'ethereum'): Promise<bigint> {
      const client = getPublicClient(network);
      return await client.estimateGas(params);
    }
  • Imports the EstimateGasParameters type from viem, used for typing the estimateGas function parameters.
    import { 
      type Address, 
      type Hash, 
      type TransactionReceipt,
      type EstimateGasParameters
    } from 'viem';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it behaves: whether it makes network calls, requires authentication, has rate limits, returns specific error types, or provides gas estimates in gwei/wei. For a tool that likely queries blockchain networks, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is perfectly concise at 7 words. It's front-loaded with the core purpose and contains zero wasted words. Every word earns its place by clearly communicating the tool's function without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of gas estimation (involving blockchain networks, transaction simulation, and unit conversions), the description is insufficient. With no annotations and no output schema, the description should provide more context about what the estimate represents (gas units, gwei/wei), typical use cases, and limitations. For a tool with 4 parameters and likely network dependencies, this is incomplete.

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 description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 description clearly states the tool's purpose: estimating gas cost for a transaction. It uses a specific verb ('estimate') and resource ('gas cost'), making it immediately understandable. However, it doesn't differentiate from potential sibling tools like 'write_contract' or 'transfer_eth' that might also involve gas estimation, keeping it from a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention whether this should be used before executing transactions (like 'transfer_eth' or 'write_contract'), or how it relates to other gas-related operations. There's no explicit when/when-not or alternative tool references.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpdotdirect/evm-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server