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
| Name | Required | Description | Default |
|---|---|---|---|
| slot | Yes |
Implementation Reference
- src/server.py:390-403 (handler)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()