Skip to main content
Glama

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

NameRequiredDescriptionDefault
commitmentNo

Input Schema (JSON Schema)

{ "properties": { "commitment": { "enum": [ "confirmed", "finalized", "processed" ], "type": "string" } }, "required": [], "type": "object" }

Implementation Reference

  • 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)}`); } }
  • 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,
  • TypeScript type definition for the input parameters used by the handler.
    export type GetEpochInfoInput = { commitment?: "confirmed" | "finalized" | "processed"; }

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