Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

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
NameRequiredDescriptionDefault
includeTransactionsNoInclude full transaction details (default: false)
networkNoNetwork type (defaults to mainnet)
slotYesBlock slot number

Implementation Reference

  • 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, }; }
  • 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)) ||

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