get_solana_block
Retrieve Solana blockchain block data including transaction details when needed for analysis or verification purposes.
Instructions
Get Solana block information with optional transactions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeTransactions | No | Include full transaction details (default: false) | |
| network | No | Network type (defaults to mainnet) | |
| slot | Yes | Block slot number |
Implementation Reference
- src/handlers/solana-handlers.ts:322-338 (handler)Main execution handler for the 'get_solana_block' tool. Parses input arguments, calls SolanaService.getBlock(), and formats the response for the MCP protocol.case 'get_solana_block': { const slot = args?.slot as number; const includeTransactions = (args?.includeTransactions as boolean) || false; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await solanaService.getBlock(slot, includeTransactions, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/solana-handlers.ts:95-117 (registration)Tool registration definition including name, description, and input schema for 'get_solana_block'. Returned by registerSolanaHandlers() and included in the server's tool list.{ name: 'get_solana_block', description: 'Get Solana block information with optional transactions', inputSchema: { type: 'object', properties: { slot: { type: 'number', description: 'Block slot number', }, includeTransactions: { type: 'boolean', description: 'Include full transaction details (default: false)', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['slot'], }, },
- Core helper method getBlock() in SolanaService that constructs Solana RPC parameters for getBlock (with configurable transaction details) and delegates to the generic blockchain RPC caller.async getBlock( slot: number, includeTransactions: boolean = false, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('solana', network); if (!service) { return { success: false, error: `Solana service not found for ${network}`, }; } const params: any = [ slot, { encoding: 'json', transactionDetails: includeTransactions ? 'full' : 'signatures', maxSupportedTransactionVersion: 0, }, ]; return this.blockchainService.callRPCMethod(service.id, 'getBlock', params); }
- src/index.ts:123-123 (registration)Registration of the Solana tool handler dispatch in the main MCP server's CallToolRequest handler. Routes execution to handleSolanaTool when the tool name matches.(await handleSolanaTool(name, args, solanaService)) ||