Skip to main content
Glama

chain_tx_cost

Read-only

chain_tx_cost — Live cost of a typical transaction on Base, Arbitrum, Optimism, Polygon and Ethereum, side by side: execution fee (gas x current gas price) plus the rollup L1 data fee read from on-chain oracles (OP Stack GasPriceOracle, ArbGasInfo), total in native coin and USD, cheapest chain and how many times cheaper than Ethereum. Params: action (native, erc20, approve, swap, nft), optional gas and bytes (unsigned tx size) to price your exact tx, chains (comma list), pol_usd (to convert Polygon fees). ETH/USD from alternative.me. Price: $0.004 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": {
      "action": "<action>"
    },
    "name": "chain_tx_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYeserc20

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered; the description adds real context on top: which on-chain oracles supply the L1 data fee, where ETH/USD comes from, that pricing is live, and — importantly — that calls cost $0.004 USDC via x402 on Base. It stops short of describing rate limits, failure modes, or staleness of the oracle reads.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded, but the body is a single dense run-on that mixes output description, data sources, parameter semantics, and billing. It is information-rich rather than padded, yet splitting the cost/payment note and the parameter list into their own sentences would make it far easier to scan.

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 carries the return-value burden and does so: totals in native coin and USD, cheapest chain, and the multiple versus Ethereum. Data provenance is named. What is missing is any statement of freshness, caching, or behavior when an oracle or the ETH/USD source is unavailable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema documents only `action` and its description is a bare "erc20"; the description repairs this by enumerating the intended action values (native, erc20, approve, swap, nft) and by explaining gas, bytes (unsigned tx size), chains, and pol_usd, none of which appear in the schema at all. The added meaning is substantial, though the schema/description drift itself is a defect an agent could trip over.

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?

States a specific verb and resource — the live cost of a typical transaction across five named chains — and breaks the result into execution fee plus L1 data fee, native and USD totals, cheapest chain, and the Ethereum multiple. An agent can tell this apart from generic siblings like chain_tx or chain_blob_fees without opening anything else.

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?

Usage is implied rather than stated: the reader infers this is the tool for comparing per-transaction cost across chains, and that supplying gas/bytes prices an exact tx instead of a typical one. There is no explicit when-not guidance or named alternative for adjacent questions (e.g., current gas prices alone, or blob fees).

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