helius_get_leader_schedule
Retrieve the leader schedule for a specific Solana epoch using the Helius API, providing details on validator assignments by slot and commitment level for blockchain operations and analysis.
Instructions
Get the leader schedule for an epoch
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No | ||
| slot | No |
Input Schema (JSON Schema)
{
"properties": {
"commitment": {
"enum": [
"confirmed",
"finalized",
"processed"
],
"type": "string"
},
"slot": {
"type": "number"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:291-299 (handler)The core handler function implementing the 'helius_get_leader_schedule' tool. It invokes the Solana RPC getLeaderSchedule method via the Helius client connection, ignoring input parameters as per comment.export const getLeaderScheduleHandler = async (input: GetLeaderScheduleInput): Promise<ToolResultSchema> => { try { // getLeaderSchedule doesn't accept parameters in the real SDK const leaderSchedule = await (helius as any as Helius).connection.getLeaderSchedule(); return createSuccessResponse(`Leader schedule: ${JSON.stringify(leaderSchedule, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting leader schedule: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:242-253 (schema)Input schema definition for the 'helius_get_leader_schedule' tool, specifying optional slot and commitment parameters.{ name: "helius_get_leader_schedule", description: "Get the leader schedule for an epoch", inputSchema: { type: "object", properties: { slot: { type: "number" }, commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: [] } },
- src/tools.ts:568-568 (registration)Registration of the handler function in the central handlers dictionary, mapping tool name to its executor."helius_get_leader_schedule": getLeaderScheduleHandler,