Skip to main content
Glama

get_block_number

Retrieve the current Ethereum block number to synchronize transactions, verify network status, or timestamp blockchain activities.

Instructions

Get the latest block number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Defines the schema for the 'get_block_number' tool, which requires no input parameters and returns the latest block number. This is part of the tools list returned by listTools.
    {
      name: "get_block_number",
      description: "Get the latest block number",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • index.ts:408-977 (registration)
    Registers the 'get_block_number' tool by including it in the tools array served by the listTools MCP request handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        // NFT API Tools
        {
          name: "get_nfts_for_owner",
          description: "Get NFTs owned by a specific wallet address",
          inputSchema: {
            type: "object",
            properties: {
              owner: {
                type: "string",
                description: "The wallet address to get NFTs for",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of NFTs to return in one page (max: 100)",
              },
              contractAddresses: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "List of contract addresses to filter by",
              },
              withMetadata: {
                type: "boolean",
                description: "Whether to include NFT metadata",
              },
            },
            required: ["owner"],
          },
        },
        {
          name: "get_nft_metadata",
          description: "Get metadata for a specific NFT",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT",
              },
              tokenId: {
                type: "string",
                description: "The token ID of the NFT",
              },
              tokenType: {
                type: "string",
                description: "The token type (ERC721 or ERC1155)",
              },
              refreshCache: {
                type: "boolean",
                description: "Whether to refresh the cache",
              },
            },
            required: ["contractAddress", "tokenId"],
          },
        },
        {
          name: "get_nft_sales",
          description: "Get NFT sales data for a contract or specific NFT",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT collection",
              },
              tokenId: {
                type: "string",
                description: "The token ID of the specific NFT",
              },
              fromBlock: {
                type: "number",
                description: "Starting block number for the query",
              },
              toBlock: {
                type: "number",
                description: "Ending block number for the query",
              },
              order: {
                type: "string",
                enum: ["asc", "desc"],
                description: "Order of results (ascending or descending)",
              },
              marketplace: {
                type: "string",
                description:
                  "Filter by marketplace (e.g., 'seaport', 'wyvern')",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of results per page",
              },
            },
          },
        },
        {
          name: "get_contracts_for_owner",
          description: "Get NFT contracts owned by an address",
          inputSchema: {
            type: "object",
            properties: {
              owner: {
                type: "string",
                description: "The wallet address to get contracts for",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of results per page",
              },
              includeFilters: {
                type: "array",
                items: {
                  type: "string",
                  enum: ["spam", "airdrops"],
                },
                description: "Filters to include in the response",
              },
              excludeFilters: {
                type: "array",
                items: {
                  type: "string",
                  enum: ["spam", "airdrops"],
                },
                description: "Filters to exclude from the response",
              },
            },
            required: ["owner"],
          },
        },
        {
          name: "get_floor_price",
          description: "Get floor price for an NFT collection",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT collection",
              },
            },
            required: ["contractAddress"],
          },
        },
        {
          name: "get_owners_for_nft",
          description: "Get owners of a specific NFT",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT",
              },
              tokenId: {
                type: "string",
                description: "The token ID of the NFT",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of results per page",
              },
            },
            required: ["contractAddress", "tokenId"],
          },
        },
        {
          name: "get_nfts_for_contract",
          description: "Get all NFTs for a contract",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT collection",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of results per page",
              },
              tokenUriTimeoutInMs: {
                type: "number",
                description: "Timeout for token URI resolution in milliseconds",
              },
              withMetadata: {
                type: "boolean",
                description: "Whether to include metadata",
              },
            },
            required: ["contractAddress"],
          },
        },
        {
          name: "get_transfers_for_contract",
          description: "Get transfers for an NFT contract",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the NFT collection",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              fromBlock: {
                type: "number",
                description: "Starting block number for the query",
              },
              toBlock: {
                type: "number",
                description: "Ending block number for the query",
              },
              order: {
                type: "string",
                enum: ["asc", "desc"],
                description: "Order of results (ascending or descending)",
              },
              tokenType: {
                type: "string",
                enum: ["ERC721", "ERC1155"],
                description: "Type of token (ERC721 or ERC1155)",
              },
            },
            required: ["contractAddress"],
          },
        },
        {
          name: "get_transfers_for_owner",
          description: "Get NFT transfers for an owner",
          inputSchema: {
            type: "object",
            properties: {
              owner: {
                type: "string",
                description: "The wallet address to get transfers for",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              fromBlock: {
                type: "number",
                description: "Starting block number for the query",
              },
              toBlock: {
                type: "number",
                description: "Ending block number for the query",
              },
              order: {
                type: "string",
                enum: ["asc", "desc"],
                description: "Order of results (ascending or descending)",
              },
              tokenType: {
                type: "string",
                enum: ["ERC721", "ERC1155"],
                description: "Type of token (ERC721 or ERC1155)",
              },
              contractAddresses: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "List of contract addresses to filter by",
              },
            },
            required: ["owner"],
          },
        },
    
        // Core API Tools
        {
          name: "get_token_balances",
          description: "Get token balances for a specific address",
          inputSchema: {
            type: "object",
            properties: {
              address: {
                type: "string",
                description: "The wallet address to get token balances for",
              },
              tokenAddresses: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "List of token addresses to filter by",
              },
            },
            required: ["address"],
          },
        },
        {
          name: "get_token_metadata",
          description: "Get metadata for a token contract",
          inputSchema: {
            type: "object",
            properties: {
              contractAddress: {
                type: "string",
                description: "The contract address of the token",
              },
            },
            required: ["contractAddress"],
          },
        },
        {
          name: "get_tokens_for_owner",
          description: "Get tokens owned by an address",
          inputSchema: {
            type: "object",
            properties: {
              owner: {
                type: "string",
                description: "The wallet address to get tokens for",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              pageSize: {
                type: "number",
                description: "Number of results per page",
              },
              contractAddresses: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "List of contract addresses to filter by",
              },
            },
            required: ["owner"],
          },
        },
        {
          name: "get_asset_transfers",
          description: "Get asset transfers for a specific address or contract",
          inputSchema: {
            type: "object",
            properties: {
              fromBlock: {
                type: "string",
                description: 'The starting block (hex string or "latest")',
              },
              toBlock: {
                type: "string",
                description: 'The ending block (hex string or "latest")',
              },
              fromAddress: {
                type: "string",
                description: "The sender address",
              },
              toAddress: {
                type: "string",
                description: "The recipient address",
              },
              category: {
                type: "array",
                items: {
                  type: "string",
                  enum: [
                    "external",
                    "internal",
                    "erc20",
                    "erc721",
                    "erc1155",
                    "specialnft",
                  ],
                },
                description:
                  'The category of transfers to include (e.g., "external", "internal", "erc20", "erc721", "erc1155", "specialnft")',
              },
              contractAddresses: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "List of contract addresses to filter by",
              },
              maxCount: {
                type: "number",
                description: "The maximum number of results to return",
              },
              excludeZeroValue: {
                type: "boolean",
                description: "Whether to exclude zero value transfers",
              },
              pageKey: {
                type: "string",
                description: "Key for pagination",
              },
              withMetadata: {
                type: "boolean",
                description: "Whether to include metadata in the response",
              },
            },
          },
        },
        {
          name: "get_transaction_receipts",
          description: "Get transaction receipts for a block",
          inputSchema: {
            type: "object",
            properties: {
              blockHash: {
                type: "string",
                description: "The hash of the block",
              },
              blockNumber: {
                type: "string",
                description: "The number of the block",
              },
            },
            oneOf: [{ required: ["blockHash"] }, { required: ["blockNumber"] }],
          },
        },
        {
          name: "get_block_number",
          description: "Get the latest block number",
          inputSchema: {
            type: "object",
            properties: {},
          },
        },
        {
          name: "get_block_with_transactions",
          description: "Get a block with its transactions",
          inputSchema: {
            type: "object",
            properties: {
              blockNumber: {
                type: "string",
                description: "The block number",
              },
              blockHash: {
                type: "string",
                description: "The block hash",
              },
            },
            oneOf: [{ required: ["blockNumber"] }, { required: ["blockHash"] }],
          },
        },
        {
          name: "get_transaction",
          description: "Get transaction details by hash",
          inputSchema: {
            type: "object",
            properties: {
              hash: {
                type: "string",
                description: "The transaction hash",
              },
            },
            required: ["hash"],
          },
        },
        {
          name: "resolve_ens",
          description: "Resolve an ENS name to an address",
          inputSchema: {
            type: "object",
            properties: {
              name: {
                type: "string",
                description: "The ENS name to resolve",
              },
              blockTag: {
                type: "string",
                description: "The block tag to use for resolution",
              },
            },
            required: ["name"],
          },
        },
        {
          name: "lookup_address",
          description: "Lookup the ENS name for an address",
          inputSchema: {
            type: "object",
            properties: {
              address: {
                type: "string",
                description: "The address to lookup",
              },
            },
            required: ["address"],
          },
        },
        {
          name: "estimate_gas_price",
          description: "Estimate current gas price",
          inputSchema: {
            type: "object",
            properties: {
              maxFeePerGas: {
                type: "boolean",
                description:
                  "Whether to include maxFeePerGas and maxPriorityFeePerGas",
              },
            },
          },
        },
    
        // WebSocket Subscription Tools
        {
          name: "subscribe",
          description: "Subscribe to blockchain events",
          inputSchema: {
            type: "object",
            properties: {
              type: {
                type: "string",
                enum: ["newHeads", "logs", "pendingTransactions", "mined"],
                description: "The type of subscription",
              },
              address: {
                type: "string",
                description: "The address to filter by (for logs)",
              },
              topics: {
                type: "array",
                items: {
                  type: "string",
                },
                description: "The topics to filter by (for logs)",
              },
            },
            required: ["type"],
          },
        },
        {
          name: "unsubscribe",
          description: "Unsubscribe from blockchain events",
          inputSchema: {
            type: "object",
            properties: {
              subscriptionId: {
                type: "string",
                description: "The ID of the subscription to cancel",
              },
            },
            required: ["subscriptionId"],
          },
        },
      ],
    }));
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't clarify if this is a read-only operation, how frequently it can be called, what network or blockchain it targets, or error conditions. 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 a single, clear sentence with no wasted words. It's front-loaded with the essential information ('Get the latest block number'), making it highly efficient and easy to parse.

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's simplicity (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks context about the blockchain environment, return format, or error handling, which could be helpful for an AI agent to use it correctly in varied scenarios.

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 zero parameters, and the schema description coverage is 100%, so there's no need for parameter documentation in the description. The description correctly focuses on the tool's purpose without unnecessary parameter details, earning a baseline high score for this dimension.

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 tool's purpose with a specific verb ('Get') and resource ('latest block number'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_block_with_transactions', which might retrieve more detailed block information.

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. With siblings like 'get_block_with_transactions' that might return similar or overlapping data, there's no indication of trade-offs, prerequisites, or specific contexts where this simpler tool is preferred.

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

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/itsanishjain/alchemy-sdk-mcp'

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