Skip to main content
Glama

Estimate gas

estimate_gas
Read-onlyIdempotent

Estimates the gas a transaction would use (eth_estimateGas) and what it would cost at the node's current gas price: fee = gas × gas price, in wei and LAX. Takes the same call fields as call_contract (to, from, value_wei, and data or function+args) and nothing is sent. A plain LAX transfer uses 21,000 gas. Fails with the revert reason when the transaction would revert.

Input Schema

NameRequiredDescriptionDefault
toYescontract address
abiNocontract ABI as a JSON string; when omitted the explorer's verified ABI is used
argsNofunction arguments as a JSON array; big integers as decimal strings
dataNoraw 0x-hex calldata; alternative to function+args
fromNosender address (optional)
blockNoblock number, hash or "latest" (default)
functionNofunction name resolved via abi or the verified ABI, or a full signature such as "balanceOf(address) returns (uint256)"
value_weiNoLAX to send with the call, in wei (decimal)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real behavioral context beyond them: the fee formula, the wei-and-LAX denomination, no state change ('nothing is sent'), the 21,000-gas baseline for a plain transfer, and revert-reason error behavior. This is exactly the extra context annotations cannot carry.

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?

Three sentences, front-loaded with the core action and output formula, with no filler. Each sentence carries distinct information: output shape, parameter shape, baseline gas, and failure mode.

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

Completeness5/5

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

There is no output schema, so the description must carry return semantics — and it does, specifying gas, fee in wei and LAX, the formula, and the revert-reason failure path. Nothing an agent needs to invoke or interpret this tool is missing.

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%, so the baseline is 3; the description adds meaning by grouping the 8 params into the call-field shape shared with call_contract and by clarifying that data is an alternative to function+args. Marginal but genuine added semantics over the 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?

States a specific verb and resource (estimates gas for a transaction) and pins it to the eth_estimateGas RPC, plus states the derived output (fee = gas × gas price). It is clearly distinguishable from gas_price (which returns a price, not an estimate) and from call_contract (which actually sends).

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?

Gives clear context for when this applies: it takes the same call fields as call_contract but 'nothing is sent', which effectively routes the agent to estimate_gas for pre-flight checks. It falls short of an explicit when-not/alternative statement (e.g. 'use call_contract to actually execute'), so it is strong but not fully explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.