helius_get_epoch_info
Retrieve current epoch details, including block height and stake distribution, from the Solana blockchain via MCP Helius. Specify commitment level to access confirmed, finalized, or processed data.
Instructions
Get information about the current epoch
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No |
Input Schema (JSON Schema)
{
"properties": {
"commitment": {
"enum": [
"confirmed",
"finalized",
"processed"
],
"type": "string"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:272-279 (handler)The main handler function that executes the tool logic by fetching epoch information from the Solana RPC via Helius.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)Defines the input schema and tool metadata for 'helius_get_epoch_info' in the tools registry.{ 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)Registers the handler function for the 'helius_get_epoch_info' tool in the handlers dictionary."helius_get_epoch_info": getEpochInfoHandler,
- src/handlers/helius.types.ts:130-132 (schema)TypeScript type definition for the input parameters used by the handler.export type GetEpochInfoInput = { commitment?: "confirmed" | "finalized" | "processed"; }