Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_blocks

Retrieve a list of confirmed blocks between specified Solana blockchain slots using the MCP server. Ideal for analyzing transaction history or verifying block data.

Instructions

Returns a list of confirmed blocks between two slots.

Args: start_slot (int): Start slot as u64 integer end_slot (Optional[int], optional): End slot as u64 integer. Defaults to None.

Returns: str: List of blocks in the format "Blocks: {blocks}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_slotNo
start_slotYes

Implementation Reference

  • The main handler function for the 'get_blocks' MCP tool. It is decorated with @mcp.tool() for registration and implements the tool logic by querying the Solana RPC client for blocks between the given slots and returning a formatted string.
    @mcp.tool()
    async def get_blocks(start_slot: int, end_slot: Optional[int] = None) -> str:
        """Returns a list of confirmed blocks between two slots.
    
        Args:
            start_slot (int): Start slot as u64 integer
            end_slot (Optional[int], optional): End slot as u64 integer. Defaults to None.
    
        Returns:
            str: List of blocks in the format "Blocks: {blocks}"
        """
        async with AsyncClient(rpc_url) as client:
            blocks = await client.get_blocks(start_slot, end_slot)
            return f"Blocks: {blocks}"
  • src/server.py:89-89 (registration)
    The @mcp.tool() decorator registers the get_blocks function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a list of confirmed blocks, which implies a read-only operation, but doesn't specify details like rate limits, authentication needs, error handling, or what 'confirmed' means in this context. The description adds minimal behavioral context beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, Args, Returns), making it easy to parse. It's appropriately sized—two sentences for the core purpose plus parameter details—with no wasted words. However, the 'Returns' section could be more concise by integrating with the main description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, and no output schema, the description provides basic purpose and parameter documentation but lacks depth. It doesn't cover behavioral aspects like error cases or performance, and the return format description ('List of blocks in the format "Blocks: {blocks}"') is vague. For a tool with two parameters and no structured support, this is minimally adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It includes an 'Args' section that documents both parameters (start_slot and end_slot) with types and defaults, adding meaningful semantics beyond the schema. However, it doesn't explain what 'slots' are in this context (e.g., blockchain slots) or provide usage examples, leaving gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Returns a list of confirmed blocks between two slots.' It specifies the verb ('returns'), resource ('confirmed blocks'), and scope ('between two slots'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_block' (singular) or 'get_block_height', which might retrieve different block-related information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying it returns blocks 'between two slots,' suggesting it's for retrieving a range of blocks. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_block' (for a single block) or 'get_block_height' (for height information). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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