Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

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}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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()

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/tywenk/mcp-sol'

If you have feedback or need assistance with the MCP directory API, please join our Discord server