helius_get_leader_schedule
Retrieve the leader schedule for a specific epoch on Solana. Specify an optional slot and commitment level to filter results.
Instructions
Get the leader schedule for an epoch
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "helius_get_leader_schedule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | No | ||
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:291-299 (handler)The main handler function for the helius_get_leader_schedule tool. Calls connection.getLeaderSchedule() and returns the leader schedule for an epoch as a JSON string. Note: the slot and commitment input parameters are defined in the schema but not actually used in the handler.
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/handlers/helius.types.ts:138-141 (schema)TypeScript type definition for GetLeaderScheduleInput with optional slot (number) and commitment fields.
export type GetLeaderScheduleInput = { slot?: number; commitment?: "confirmed" | "finalized" | "processed"; } - src/tools.ts:242-252 (registration)Tool registration entry: defines the tool name 'helius_get_leader_schedule', description, and input JSON schema (slot and commitment properties).
{ 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)Handler mapping: maps the tool name 'helius_get_leader_schedule' to the getLeaderScheduleHandler function.
"helius_get_leader_schedule": getLeaderScheduleHandler, - src/tools.ts:21-21 (helper)Import statement for getLeaderScheduleHandler from the handlers module.
getLeaderScheduleHandler,