Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_block_commitment

Retrieve commitment details for a specific block slot on the Solana blockchain using the Model Context Protocol Server, facilitating accurate block-level data access and verification.

Instructions

Fetch the commitment for particular block.

Args: slot (int): Block slot number to query

Returns: str: Block commitment information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYes

Implementation Reference

  • The handler function for the get_block_commitment tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function takes a slot number, queries the Solana RPC client for the block commitment, and returns it formatted as a string.
    @mcp.tool() async def get_block_commitment(slot: int) -> str: """Fetch the commitment for particular block. Args: slot (int): Block slot number to query Returns: str: Block commitment information """ async with AsyncClient(rpc_url) as client: commitment = await client.get_block_commitment(slot) return f"Block commitment: {commitment}"
  • src/server.py:390-390 (registration)
    The @mcp.tool() decorator registers the get_block_commitment 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