Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_solana_block_height

Retrieve current Solana blockchain block height to monitor network status and synchronize applications with the distributed ledger.

Instructions

Get the latest Solana block height

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Handler logic for executing the get_solana_block_height tool. Extracts network parameter and delegates to SolanaService.getBlockHeight, then formats the response.
    case 'get_solana_block_height': { const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await solanaService.getBlockHeight(network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Core implementation of block height retrieval. Gets the Solana RPC service for the network and calls the 'getBlockHeight' RPC method.
    /** * Get latest block height */ async getBlockHeight( 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}`, }; } return this.blockchainService.callRPCMethod(service.id, 'getBlockHeight', []); }
  • Input schema definition for the get_solana_block_height tool, specifying optional network parameter.
    { name: 'get_solana_block_height', description: 'Get the latest Solana block height', inputSchema: { type: 'object', properties: { network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, }, },
  • src/index.ts:97-97 (registration)
    Registers the Solana tools, including get_solana_block_height, with the MCP server.
    ...registerSolanaHandlers(server, 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