get_leader_schedule
Retrieve the leader schedule for a specific epoch on the Solana blockchain, providing insights into validator rotations and block production timing.
Instructions
Returns the leader schedule for an epoch.
Args: epoch (Optional[int]): Epoch to get schedule for
Returns: str: Leader schedule information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epoch | No |
Implementation Reference
- src/server.py:499-512 (handler)The handler function for the 'get_leader_schedule' tool. It fetches the leader schedule for a given epoch (or current) using the Solana AsyncClient and returns a formatted string with the schedule.@mcp.tool() async def get_leader_schedule(epoch: Optional[int] = None) -> str: """Returns the leader schedule for an epoch. Args: epoch (Optional[int]): Epoch to get schedule for Returns: str: Leader schedule information """ async with AsyncClient(rpc_url) as client: schedule = await client.get_leader_schedule(epoch) return f"Leader schedule: {schedule}"