Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_block

Retrieve identity and transaction details for a confirmed block on the Solana blockchain using a specified slot number.

Instructions

Returns identity and transaction information about a confirmed block in the ledger.

Args: slot (int): Slot number as u64 integer

Returns: str: Block information in the format "Block: {block}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYes

Implementation Reference

  • The main handler function for the 'get_block' MCP tool. It is decorated with @mcp.tool() which registers it automatically. The function takes a slot integer, fetches the block data from the Solana RPC client, and returns a formatted string representation. The docstring provides the input/output schema description used by MCP.
    @mcp.tool() async def get_block(slot: int) -> str: """Returns identity and transaction information about a confirmed block in the ledger. Args: slot (int): Slot number as u64 integer Returns: str: Block information in the format "Block: {block}" """ async with AsyncClient(rpc_url) as client: block = await client.get_block(slot) return f"Block: {block}"
  • src/server.py:47-47 (registration)
    The @mcp.tool() decorator registers the get_block 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