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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:848-855 (schema)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"], }, }, ], }));