estimate_gas
chainpeek: Estimate the gas of a transaction on Ethereum, Base or Robinhood Chain. For the gas price use get_gas; for a whole transfer check use transfer_preflight. Returns the node's gas estimate (gas) for a transaction from from to to with data and value_wei, plus gas_with_20pct_buffer; omit to with data to estimate a contract creation. Nothing is signed or sent. Input: chain, to, optional from, data and value_wei; send to or data. Estimated at the latest block against current state, so the real cost can differ. A transaction that would revert is a 422 reverted (not charged). Ethereum, Base and Robinhood only; read-only: nothing is signed or sent. RPC reads are cached up to 30 s. A bad address, hash, hex string, block or range is a 422 before any payment (not charged). Typically under 1 s. Price: USD 0.002. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/ethereum-rpc-reads-api.html
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": {
"chain": "<chain>"
},
"name": "estimate_gas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Recipient. Omit with `data` to estimate a contract creation. | |
| data | No | Calldata, 0x-hex with an even number of digits, at most 8 kB. | |
| from | No | Sender (affects balance and allowance checks). | |
| chain | Yes | ethereum, base or robinhood (Robinhood Chain, chain id 4663). | |
| value_wei | No | Native value in wei, as a decimal or 0x-hex string. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| gas | No | ||
| from | No | ||
| note | No | ||
| chain | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| contract_creation | No | ||
| gas_with_20pct_buffer | No |