Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_block_time

Retrieve the estimated production time of a specific block on the Solana blockchain by providing its slot number. Returns the block time in a clear, formatted string.

Instructions

Fetch the estimated production time of a block.

Args: slot (int): Block slot number

Returns: str: Block time in the format "Block time: {time}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYes

Implementation Reference

  • The handler function for the 'get_block_time' tool. It uses AsyncClient to fetch the block time for a given slot from the Solana RPC and formats the response as a string. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool() async def get_block_time(slot: int) -> str: """Fetch the estimated production time of a block. Args: slot (int): Block slot number Returns: str: Block time in the format "Block time: {time}" """ async with AsyncClient(rpc_url) as client: time = await client.get_block_time(slot) return f"Block time: {time}"

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