Skip to main content
Glama

network_get_fee_data

Retrieve current Ethereum and EVM-compatible blockchain fee data, including base fee and max priority fee, for accurate transaction cost estimation.

Instructions

Get the current fee data (base fee, max priority fee, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getFeeDataHandler function that implements the core logic of the network_get_fee_data tool by fetching fee data from the Ethers provider.
    export const getFeeDataHandler = async (input: any): Promise<ToolResultSchema> => {
      try {
        const provider = getProvider();
        if (!provider) {
          return createErrorResponse("Provider is required to get fee data, please set the provider URL");
        }
        // getFeeData is available in ethers v5.5.0+
        // @ts-ignore - getFeeData might not be in the type definitions depending on the version
        const feeData = await provider.getFeeData();
    
        return createSuccessResponse(`Fee data retrieved successfully
          Gas price: ${feeData.gasPrice?.toString()}
          Max fee per gas: ${feeData.maxFeePerGas?.toString()}
          Max priority fee per gas: ${feeData.maxPriorityFeePerGas?.toString()}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to get fee data: ${(error as Error).message}`);
      }
    };
  • The tool schema defining the name, description, and empty input schema for network_get_fee_data.
    {
      name: "network_get_fee_data",
      description: "Get the current fee data (base fee, max priority fee, etc.)",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    }
  • src/tools.ts:556-608 (registration)
    The handlers dictionary registration that maps the tool name 'network_get_fee_data' to its handler function getFeeDataHandler.
    export const handlers: HandlerDictionary = {
      // Provider Methods
      "wallet_provider_set": setProviderHandler,
      // Wallet Creation and Management
      "wallet_create_random": createWalletHandler,
      "wallet_from_private_key": fromPrivateKeyHandler,
      "wallet_from_mnemonic": fromMnemonicHandler,
      "wallet_from_encrypted_json": fromEncryptedJsonHandler,
      "wallet_encrypt": encryptWalletHandler,
    
      // Wallet Properties
      "wallet_get_address": getAddressHandler,
      "wallet_get_public_key": getPublicKeyHandler,
      "wallet_get_private_key": getPrivateKeyHandler,
    
      // Blockchain Methods
      "wallet_get_balance": getBalanceHandler,
      "wallet_get_chain_id": getChainIdHandler,
      "wallet_get_gas_price": getGasPriceHandler,
      "wallet_get_transaction_count": getTransactionCountHandler,
      "wallet_call": callHandler,
    
      // Transaction Methods
      "wallet_send_transaction": sendTransactionHandler,
      "wallet_sign_transaction": signTransactionHandler,
      "wallet_populate_transaction": populateTransactionHandler,
    
      // Signing Methods
      "wallet_sign_message": signMessageHandler,
      "wallet_sign_typed_data": signTypedDataHandler,
      "wallet_verify_message": verifyMessageHandler,
      "wallet_verify_typed_data": verifyTypedDataHandler,
    
      // Provider Methods
      "provider_get_block": getBlockHandler,
      "provider_get_transaction": getTransactionHandler,
      "provider_get_transaction_receipt": getTransactionReceiptHandler,
      "provider_get_code": getCodeHandler,
      "provider_get_storage_at": getStorageAtHandler,
      "provider_estimate_gas": estimateGasHandler,
      "provider_get_logs": getLogsHandler,
      "provider_get_ens_resolver": getEnsResolverHandler,
      "provider_lookup_address": lookupAddressHandler,
      "provider_resolve_name": resolveNameHandler,
    
      // Network Methods
      "network_get_network": getNetworkHandler,
      "network_get_block_number": getBlockNumberHandler,
      "network_get_fee_data": getFeeDataHandler,
    
      // Mnemonic Methods
      "wallet_create_mnemonic_phrase": createMnemonicPhraseHandler
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'Get[s]' data, implying a read-only operation, but doesn't specify if it's real-time, cached, requires network access, has rate limits, or error conditions. For a tool with zero annotation coverage, this is a significant gap in transparency about its operational behavior.

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 a single, efficient sentence that front-loads the core purpose ('Get the current fee data') and adds clarifying examples ('base fee, max priority fee, etc.') without redundancy. Every word contributes value, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, no annotations, and no output schema, the description is minimally adequate. It explains what the tool does but lacks details on behavior, output format, or integration context. For a simple read operation, this might suffice, but the absence of output schema means the agent doesn't know what data to expect, leaving clear gaps in completeness.

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?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce unnecessary complexity.

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?

The description clearly states the action ('Get') and the resource ('current fee data'), with specific examples of what that includes ('base fee, max priority fee, etc.'). It distinguishes itself from siblings like 'wallet_get_gas_price' by focusing on broader fee data rather than just gas price. However, it doesn't explicitly differentiate from all siblings, such as 'provider_get_block' which might also contain fee data, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., for transaction planning), or compare to siblings like 'wallet_get_gas_price' or 'provider_get_block' that might offer overlapping or related data. This lack of usage context leaves the agent with minimal direction.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dcSpark/mcp-cryptowallet-evm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server