Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_block_details

Retrieve detailed blockchain block information, including optional transaction data, to analyze network activity and verify transactions across supported networks.

Instructions

Get detailed block information with optional transaction list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
blockNumberYesBlock number (number or "latest", "earliest", "pending")
includeTransactionsNoInclude full transaction objects (default: false)
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • MCP tool handler for get_block_details: extracts arguments, performs safety check for large responses, calls service, and formats 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'; // SAFETY CHECK: Block queries with full transactions const safetyCheck = checkBlockQuery( 'eth_getBlockByNumber', [blockNumber, includeTransactions] ); if (!safetyCheck.safe) { return { content: [ { type: 'text', text: `⛔ UNSAFE BLOCK QUERY BLOCKED\n\n` + `Reason: ${safetyCheck.reason}\n\n` + `Suggestion: ${safetyCheck.suggestion}\n\n` + `This protection prevents session crashes from large responses.`, }, ], isError: true, }; } const result = await advancedBlockchain.getBlockDetails( blockchain, blockNumber, includeTransactions, network ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Input schema and tool metadata definition for get_block_details tool.
    { 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'], }, },
  • Core implementation: retrieves blockchain service and calls eth_getBlockByNumber RPC method with proper block parameter formatting.
    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] ); }

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/buildwithgrove/mcp-pocket'

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