Skip to main content
Glama

network_get_block_number

Retrieve the current block number from the Ethereum or EVM-compatible blockchain for accurate synchronization and transaction tracking in wallet operations.

Instructions

Get the current block number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function getBlockNumberHandler that executes the tool logic: retrieves the Ethereum provider and calls getBlockNumber() to return the current block number.
    export const getBlockNumberHandler = async (input: any): Promise<ToolResultSchema> => {
      try {
        const provider = getProvider();
        if (!provider) {
          return createErrorResponse("Provider is required to get block number, please set the provider URL");
        }
        const blockNumber = await provider.getBlockNumber();
    
        return createSuccessResponse(
        `Block number retrieved successfully
          Block number: ${blockNumber.toString()}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to get block number: ${(error as Error).message}`);
      }
    };
  • Tool schema definition including name, description, and input schema (no parameters required).
    {
      name: "network_get_block_number",
      description: "Get the current block number",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • src/tools.ts:602-604 (registration)
    Registration of the network_get_block_number tool handler in the handlers dictionary, mapping the tool name to getBlockNumberHandler.
    "network_get_network": getNetworkHandler,
    "network_get_block_number": getBlockNumberHandler,
    "network_get_fee_data": getFeeDataHandler,
  • src/tools.ts:1-36 (registration)
    Import statement that brings in the getBlockNumberHandler from the handlers/wallet.ts file.
    import {
      createWalletHandler,
      fromPrivateKeyHandler,
      fromMnemonicHandler,
      fromEncryptedJsonHandler,
      encryptWalletHandler,
      getAddressHandler,
      getPublicKeyHandler,
      getPrivateKeyHandler,
      getBalanceHandler,
      getChainIdHandler,
      getGasPriceHandler,
      getTransactionCountHandler,
      callHandler,
      sendTransactionHandler,
      signTransactionHandler,
      populateTransactionHandler,
      signMessageHandler,
      signTypedDataHandler,
      verifyMessageHandler,
      verifyTypedDataHandler,
      getBlockHandler,
      getTransactionHandler,
      getTransactionReceiptHandler,
      getCodeHandler,
      getStorageAtHandler,
      estimateGasHandler,
      getLogsHandler,
      getEnsResolverHandler,
      lookupAddressHandler,
      resolveNameHandler,
      getNetworkHandler,
      getBlockNumberHandler,
      getFeeDataHandler,
      createMnemonicPhraseHandler,
      setProviderHandler
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 the action ('Get') but doesn't describe any behavioral traits such as whether this is a read-only operation (implied but not stated), potential rate limits, authentication requirements, network dependencies, or what happens on failure. For a tool with zero annotation coverage, this leaves significant gaps in understanding its 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 extremely concise at just 5 words ('Get the current block number'), with zero wasted words. It's front-loaded with the core action and resource. Every word earns its place, making it easy to parse quickly without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's simplicity (0 parameters, no output schema) and lack of annotations, the description is incomplete. It doesn't explain what 'current block number' means in context (e.g., latest mined block), what format the output might be (e.g., integer, hex), or any error conditions. For a blockchain-related tool, more context about the return value and typical usage would be helpful, especially without annotations or output schema.

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 tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to explain parameters, and it correctly doesn't mention any. Since there are no parameters, the description doesn't add or detract from parameter understanding, meeting the baseline for parameter-less tools.

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 verb ('Get') and resource ('current block number'), making the purpose immediately understandable. It distinguishes this tool from siblings like provider_get_block (which retrieves full block data) and network_get_network (which gets network info), though it doesn't explicitly mention these distinctions. The purpose is specific but could be more differentiated from similar tools.

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 when this tool is appropriate (e.g., for checking blockchain progress or timing) or when to use sibling tools like provider_get_block (for detailed block data) or network_get_fee_data (for fee information). There's no context about prerequisites or typical use cases.

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