get_block_details
Retrieve detailed blockchain block information including transaction data from 70+ networks like Ethereum, Solana, and Cosmos for analysis and verification purposes.
Instructions
Get detailed block information with optional transaction list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockNumber | Yes | Block number (number or "latest", "earliest", "pending") | |
| blockchain | Yes | Blockchain name | |
| includeTransactions | No | Include full transaction objects (default: false) | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- Core handler function that executes the get_block_details tool by fetching block data via RPC.async getBlockDetails( blockchain: string, blockNumber: string | number, includeTransactions: boolean = false, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain(blockchain, network); if (!service) { return { success: false, error: `Blockchain service not found: ${blockchain} (${network})`, }; } const blockParam = typeof blockNumber === 'number' ? '0x' + blockNumber.toString(16) : blockNumber; return this.blockchainService.callRPCMethod( service.id, 'eth_getBlockByNumber', [blockParam, includeTransactions] ); }
- src/handlers/transaction-handlers.ts:84-109 (registration)Tool registration including name, description, and input schema for get_block_details.{ name: 'get_block_details', description: 'Get detailed block information with optional transaction list', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, blockNumber: { description: 'Block number (number or "latest", "earliest", "pending")', }, includeTransactions: { type: 'boolean', description: 'Include full transaction objects (default: false)', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'blockNumber'], }, },
- Helper function that handles the tool execution dispatch and formats the response.case 'get_block_details': { const blockchain = args?.blockchain as string; const blockNumber = args?.blockNumber as string | number; const includeTransactions = (args?.includeTransactions as boolean) || false; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await advancedBlockchain.getBlockDetails( blockchain, blockNumber, includeTransactions, network ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/index.ts:91-91 (registration)Final server registration where transaction handlers (including get_block_details) are added to the MCP tools list....registerTransactionHandlers(server, advancedBlockchain),