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
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:64-71 (handler)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)}`); } } - src/tools.ts:46-55 (schema)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, - src/handlers/helius.types.ts:12-14 (schema)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,