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