Skip to main content
Glama
buildwithgrove

Grove Public Endpoints MCP Server

Official

get_block_details

Retrieve detailed blockchain block information with optional transaction data for analysis and verification purposes.

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

  • Tool registration object defining name 'get_block_details', description, and input schema for MCP server.
    { 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'], },
  • MCP tool handler case for 'get_block_details' including input parsing, safety validation, service delegation, and response formatting.
    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, }; }
  • Core implementation of getBlockDetails: resolves blockchain service, formats block parameter, and executes eth_getBlockByNumber RPC call.
    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'

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