get_slot_leader
Retrieve the current slot leader on the Solana blockchain using the Model Context Protocol Server. This tool provides the slot leader’s ID in a structured format for real-time blockchain interaction.
Instructions
Returns the current slot leader.
Returns: str: Slot leader in the format "Slot leader: {leader}"
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": "get_slot_leader"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:286-296 (handler)The main handler function decorated with @mcp.tool(), which implements the get_slot_leader tool by querying the Solana RPC client for the current slot leader and returning a formatted string response.
@mcp.tool() async def get_slot_leader() -> str: """Returns the current slot leader. Returns: str: Slot leader in the format "Slot leader: {leader}" """ async with AsyncClient(rpc_url) as client: leader = await client.get_slot_leader() return f"Slot leader: {leader}" - src/server.py:286-286 (registration)The @mcp.tool() decorator registers the get_slot_leader function as an MCP tool.
@mcp.tool()