Skip to main content
Glama

cast_estimate

Estimate gas for a smart contract transaction before sending it, using the target contract, function signature, arguments, optional sender/value, and network RPC URL.

Instructions

Estimate gas for a transaction (cast estimate).

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>",
      "signature": "<signature>",
      "rpcUrl": "<rpcUrl>"
    },
    "name": "cast_estimate"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesAddress of the contract
argsNoFunction arguments in order
fromNoSender address
valueNoETH value to send (in wei)
rpcUrlYesRPC URL of the network
signatureYesFunction signature, e.g. "transfer(address,uint256)"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It does not say the call is a non-mutating simulation, that it performs no state change, which RPC method backs it, or that the estimate can revert/error when the transaction would fail — all critical for a gas-estimation tool.

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?

A single short sentence, front-loaded with the action and resource, with no filler. The trailing parenthetical duplicates the tool name and is the only wasted token.

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?

With six parameters, three required, and no output schema, the definition should explain that the result is an estimated gas quantity and that signature/args form the calldata to simulate. None of this is covered, leaving the agent to guess at return shape and semantics for a moderately complex 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 every parameter including signature format and wei units is already documented in the schema. The description adds no additional meaning about how `signature` and `args` are combined into calldata or how `from` affects accuracy; 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?

States a specific verb and resource ("Estimate gas for a transaction") that cleanly separates it from cast_send (broadcast) and cast_call (execute read). The parenthetical "(cast estimate)" merely restates the name and adds nothing, and there is no explicit sibling differentiation.

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?

No guidance on when to use this versus cast_call or cast_send, and no stated prerequisites such as needing a valid rpcUrl, a deployed contract at `to`, or why providing `from`/`value` changes the result. The agent must infer that this is a pre-flight check.

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