Skip to main content
Glama

helius_get_block_height

Retrieve the current block height from the Solana blockchain to track network progress and verify transaction confirmations.

Instructions

Get the block height of the Solana blockchain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commitmentNo

Implementation Reference

  • The main handler function that executes the tool logic by calling helius.connection.getBlockHeight with optional commitment and returns formatted success or error response.
    export const getBlockHeightHandler = async (input: GetBlockHeightInput): Promise<ToolResultSchema> => { try { const blockHeight = await (helius as any as Helius).connection.getBlockHeight(input.commitment); return createSuccessResponse(`Block height: ${blockHeight}`); } catch (error) { return createErrorResponse(`Error getting block height: ${error instanceof Error ? error.message : String(error)}`); } }
  • MCP tool schema definition including name, description, and input schema for validation.
    name: "helius_get_block_height", description: "Get the block height of the Solana blockchain", inputSchema: { type: "object", properties: { commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: [] } },
  • src/tools.ts:551-551 (registration)
    Maps the tool name to its handler function in the handlers dictionary.
    "helius_get_block_height": getBlockHeightHandler,
  • TypeScript interface defining the input parameters for the getBlockHeightHandler.
    export type GetBlockHeightInput = { commitment?: "confirmed" | "finalized" | "processed"; }
  • src/tools.ts:5-5 (registration)
    Import statement that brings the getBlockHeightHandler into src/tools.ts for registration.
    getBlockHeightHandler,

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/dcSpark/mcp-server-helius'

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