Skip to main content
Glama

Estimate transaction cost

estimate_transaction
Read-only

Estimates the gas limit and CELO cost of a transaction at the current gas price without signing or sending it. Use it to preview fees before submitting.

Instructions

Estimate the gas limit and CELO cost of a transaction at the current gas price. Nothing is signed or sent.

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": {
      "to": "<to>",
      "from_address": "<from_address>"
    },
    "name": "estimate_transaction"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesThe recipient address.
dataNoHex-encoded calldata.0x
valueNoCELO to send, in wei.0
from_addressYesThe sender address.

Output Schema

NameRequiredDescriptionDefault
gas_limitYesEstimated gas limit
gas_priceYesCurrent gas price
is_eip1559NoWhether EIP-1559 is supported
estimated_costYesEstimated cost in wei
max_fee_per_gasNoMax fee per gas (EIP-1559)
estimated_cost_formattedYesFormatted cost in CELO
max_priority_fee_per_gasNoMax priority fee per gas (EIP-1559)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true; the sentence 'Nothing is signed or sent' usefully reinforces that no side effects occur, which is the main behavioral risk an agent would worry about for a transaction-shaped tool. It adds nothing further about failure modes (e.g., whether a reverting call yields an error or a gas estimate) or about network dependency.

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?

Two short sentences, front-loaded with the purpose and closed with the safety guarantee. No filler, no restatement of the tool name beyond what is needed.

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?

With an output schema present, the description needn't explain return values, and 100% parameter coverage is handled by the schema. What remains missing is only sibling differentiation against estimate_contract_gas, which is a modest gap for an otherwise self-contained estimation tool.

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 all four parameters (to, data, value, from_address) are already fully documented in the schema with defaults. The description adds no additional meaning such as address format quirks, wei conversion caveats, or how calldata affects the estimate. Baseline 3 applies.

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?

A specific verb (estimate) paired with specific outputs (gas limit and CELO cost) at a defined condition (current gas price). An agent knows exactly what it gets back. It does not, however, distinguish itself from the sibling estimate_contract_gas, so the agent must infer the boundary.

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?

There is no explicit when-to-use guidance, no prerequisites, and no mention of the obvious alternative estimate_contract_gas or of how this relates to get_gas_fee_data. The phrase 'at the current gas price' hints at the context but stops short of routing the agent anywhere.

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