Skip to main content
Glama

eth_estimateGas

Estimate the gas required for an Ethereum transaction by providing sender, recipient, and value in wei, without broadcasting. Supports mainnet and testnets like sepolia.

Instructions

Estimate the gas required to execute a transaction without broadcasting it.

Args:

  • from (string): Sender address (20-byte hex, e.g., '0x...').

  • to (string): Recipient address (20-byte hex, e.g., '0x...').

  • value (string): Amount to send in wei as hex (e.g., '0xde0b6b3a7640000' for 1 ETH).

  • network (string, optional): Ethereum network to query. Defaults to 'mainnet'.

Returns:

  • Hexadecimal string representing estimated gas units (e.g., '0x5208' for 21000 gas).

Examples:

  • "Estimate ETH transfer": { "from": "0xYourAddress", "to": "0xRecipient", "value": "0xde0b6b3a7640000" }

  • "Estimate on Sepolia": { "from": "0x...", "to": "0x...", "value": "0x0", "network": "sepolia" }

Errors:

  • InvalidParams: When address format or value format is invalid.

  • InternalError: When transaction would revert or Infura API fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesThe address from which the transaction is sent.
toYesThe address to which the transaction is sent.
valueYesThe amount of Ether to send (in wei).
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior4/5

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

With no annotations, the description carries full burden. It discloses key behaviors: non-broadcasting, returns hex string, defaults to mainnet, and errors. It lacks discussion of rate limits or authentication, but adequate for a read-only query.

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

Conciseness4/5

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

Well-structured with headings (Args, Returns, Examples, Errors) and front-loaded purpose. Slightly lengthy but each section adds value. Could be more concise but remains informative.

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?

No output schema, but description explains return format (hex string) with example. Covers errors and network default. Complete for a simple estimation tool with clear expected behavior.

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 100%, baseline 3. The description adds value by explaining hex formats, providing unit conversion example, and listing error conditions. However, it misses the response_format parameter, which has a schema description. Overall, adds meaningful context beyond schema.

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

Purpose5/5

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

The description explicitly states 'Estimate the gas required to execute a transaction without broadcasting it.' This clearly distinguishes it from sibling tools like eth_call (which executes) and eth_gasPrice (which returns current price).

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

Usage Guidelines4/5

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

The description provides clear context and examples (ETH transfer, Sepolia network), but does not explicitly state when not to use or compare to alternatives. It is clear enough for typical usage.

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

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/Qbandev/infura-mcp-server'

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