Skip to main content
Glama

chain_l2_fee

Read-only

OP Stack L2 fee estimate (Base/Optimism) — Full cost of a transaction on Base or Optimism = L2 execution fee (gas price x gas) + L1 data fee (GasPriceOracle getL1FeeUpperBound), in ETH and USD (Chainlink ETH/USD). Returns L1 base fee, blob base fee, scalars and estimates for ETH transfer, ERC-20 transfer, DEX swap and NFT mint. Pass chain= (base or optimism); optional gas=, data= (0x calldata) or data_bytes= for your own transaction. Price: $0.002 USDC (Base, via x402).

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": "chain_l2_fee"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesbase

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly=true, destructive=false and openWorld=true, but the description adds real value beyond them: the exact cost model, the data sources used (GasPriceOracle getL1FeeUpperBound, Chainlink ETH/USD), and the paid-API price ($0.002 USDC via x402), which is critical for an agent to know before calling. It omits failure modes and rate/error behavior, keeping it short of a 5.

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?

Front-loaded with the core purpose and the cost formula, then the inputs, then the price. Every element is relevant, though the parenthetical internals (getL1FeeUpperBound, Chainlink) make it denser than needed for an agent that only needs chain selection.

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 no output schema, the description correctly enumerates what is returned (L1 base fee, blob base fee, scalars, and estimates for ETH transfer, ERC-20 transfer, DEX swap, NFT mint), which is exactly the missing piece. It is nearly complete except for the schema/description mismatch on optional transaction parameters.

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?

The schema's description for the only parameter is degenerate ("base"), so the description does useful work by stating that 'optimism' is also valid. That gain is offset by it advertising optional gas=, data= and data_bytes= parameters that do not exist in the input schema, which could lead an agent to pass arguments that will be rejected.

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 (estimate) and resource (OP Stack L2 transaction fee) and names the concrete chains (Base/Optimism), plus the cost formula (L2 execution + L1 data fee). It does not explicitly distinguish itself from nearby siblings such as chain_estimate_gas, chain_gas_compare or chain_fee_history, so the agent must infer which fee/gas tool applies.

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

Usage Guidelines3/5

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

Gives actionable usage for the required parameter ("Pass chain= (base or optimism)") and notes an optional path for custom transactions. However, it never states when to prefer this over chain_estimate_gas, chain_gas_compare or chain_fee_history, and no exclusions are given, so the selection logic is only implied.

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