helius_get_epoch_info
Retrieve current Solana blockchain epoch details including slot information and block production data to monitor network status and timing.
Instructions
Get information about the current epoch
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:272-279 (handler)The main handler function that executes the tool logic by calling the Helius RPC connection.getEpochInfo method with the provided commitment level and returns the epoch information.
export const getEpochInfoHandler = async (input: GetEpochInfoInput): Promise<ToolResultSchema> => { try { const epochInfo = await (helius as any as Helius).connection.getEpochInfo(input.commitment); return createSuccessResponse(`Epoch info: ${JSON.stringify(epochInfo, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting epoch info: ${error instanceof Error ? error.message : String(error)}`); } } - src/tools.ts:220-230 (schema)The tool schema definition including name, description, and input schema for the helius_get_epoch_info tool.
{ name: "helius_get_epoch_info", description: "Get information about the current epoch", inputSchema: { type: "object", properties: { commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: [] } }, - src/tools.ts:566-566 (registration)Registration of the 'helius_get_epoch_info' tool mapping its name to the getEpochInfoHandler function in the handlers dictionary.
"helius_get_epoch_info": getEpochInfoHandler, - src/handlers/helius.types.ts:130-132 (schema)TypeScript type definition for the input parameters of the getEpochInfoHandler.
export type GetEpochInfoInput = { commitment?: "confirmed" | "finalized" | "processed"; }