Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_block_height

Retrieve the current block height from a Solana node using the MCP Server. This tool provides blockchain data in the format 'Block height: {height}'.

Instructions

Returns the current block height of the node.

Returns: str: Current block height in the format "Block height: {height}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the get_block_height tool by querying the Solana RPC client for the current block height and returning a formatted string response.
    @mcp.tool()
    async def get_block_height() -> str:
        """Returns the current block height of the node.
    
        Returns:
            str: Current block height in the format "Block height: {height}"
        """
        async with AsyncClient(rpc_url) as client:
            height = await client.get_block_height()
            return f"Block height: {height}"
  • src/server.py:62-62 (registration)
    The @mcp.tool() decorator registers the get_block_height 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 the current block height and the return format, but lacks information about potential errors, rate limits, authentication requirements, or whether it's a read-only operation (though implied by 'Returns'). For a tool with zero annotation coverage, this is insufficient.

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 appropriately concise with two sentences: one stating the purpose and one detailing the return format. It's front-loaded with the core functionality. The structure is clear, though the 'Returns:' label could be slightly more integrated.

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 the tool has no parameters and no output schema, the description covers the basic purpose and return format adequately. However, it lacks context about behavioral aspects like error conditions or performance, which would be helpful for a tool in a blockchain context where nodes might be unavailable or slow.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (though trivial with no parameters). The description doesn't need to explain parameters, so it appropriately focuses on the return value. It adds value by specifying the return format, which isn't covered by the schema since there's no output schema.

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

Purpose5/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 with a specific verb ('Returns') and resource ('current block height of the node'), distinguishing it from siblings like get_block, get_blocks, get_block_time, and get_slot which return different blockchain data. It precisely defines what the tool does without ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools that return related blockchain data (e.g., get_block, get_slot, get_minimum_ledger_slot), there is no indication of when this specific tool is appropriate or what distinguishes it from similar tools in the server.

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