Skip to main content
Glama

Get Gas Price

get_gas_price
Read-only

Get current EIP-1559 gas fees on Ethereum or Base: base fee, priority fee, next-block base fee estimate, and congestion (gas_used_ratio >0.5 busy, >0.9 very congested). Optional USD estimates cover a simple transfer and a swap-like transaction. Cached 10 seconds per chain.

Use when: Use before advising a transaction — to time execution, size a gas budget, or judge congestion. Call once per decision; the 10-second cache makes rapid re-calls pointless.

Limitations: Point-in-time estimate that changes every block; USD figures are rough heuristics at 21k/150k gas, not an execution quote. Ethereum mainnet and Base only.

Alternatives: get_block, get_dex_quote

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idNoChain ID (1=Ethereum, 8453=Base)
include_usd_estimateNoIf true, include ETH spot price and rough USD cost estimates for a simple transfer (21k gas) and a swap-like transaction (150k gas).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYes
base_fee_gweiYes
eth_price_usdNo
gas_price_gweiYes
gas_used_ratioYes
priority_fee_gweiYes
next_base_fee_gweiYes
estimated_swap_cost_usdNo
estimated_transfer_cost_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / include_usd_estimate / title
      Added value: +"Include Usd Estimate"
    • addedInput schema / title
      Added value: +"mcp_get_gas_priceArguments"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

The readOnlyHint annotation already indicates this is a safe read; the description goes beyond that by adding the 10-second cache, the point-in-time/change-every-block caveat, and the rough-heuristic limitation on USD figures. That is meaningful context an agent needs before acting on the output. A small deduction because the description does not explicitly mention rate limits or error behavior, but those are not critical for a read-only gas price call.

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?

The description is tight and front-loaded: the first sentence states what the tool returns, the second gives use guidance, and the third lists limitations and alternatives. Every sentence earns its place; there is no filler or redundant restatement of the tool name.

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?

For a read-only tool with only two optional parameters, a 100%-coverage schema, and an output schema present, the description is complete enough: it covers purpose, usage timing, cache behavior, limitations, and alternatives. The only small gap is the absence of explicit error/edge-case behavior (e.g., unsupported chain handling), which is minor and not essential for correct invocation.

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 schema already explains both parameters. The description adds value by clarifying how include_usd_estimate is used (rough heuristics at 21k/150k gas) and by stating the cache implication (repeated calls are wasteful), which goes beyond simply restating 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?

The description names a specific resource (EIP-1559 gas fees on Ethereum/Base) and identifies the concrete data returned: base fee, priority fee, next-block estimate, and congestion thresholds. It also explicitly scopes the tool by chain (Ethereum and Base only) and by what it is not (an execution quote). This distinguishes it from the sibling tools get_block and get_dex_quote without needing to inspect their schemas.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance ('Use before advising a transaction') and when-not-to (calls are pointless within the 10-second cache). It also names the alternatives (get_block, get_dex_quote) to divert the agent appropriately. No exclusion is left to inference.

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.

Resources