Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_latest_blockhash

Retrieve the most recent block hash from the Solana blockchain ledger to verify or synchronize transactions and block data.

Instructions

Returns the latest block hash from the ledger.

Returns: str: Latest blockhash in the format "Latest blockhash: {blockhash}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_latest_blockhash tool. It is decorated with @mcp.tool() which registers it with the MCP server. The function creates an AsyncClient to the Solana RPC, fetches the latest blockhash, and returns a formatted string.
    @mcp.tool()
    async def get_latest_blockhash() -> str:
        """Returns the latest block hash from the ledger.
    
        Returns:
            str: Latest blockhash in the format "Latest blockhash: {blockhash}"
        """
        async with AsyncClient(rpc_url) as client:
            blockhash = await client.get_latest_blockhash()
            return f"Latest blockhash: {blockhash}"
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly describes the return format and that this is a read operation, but doesn't mention potential rate limits, network dependencies, or what happens if the ledger is unavailable. For a zero-parameter read tool, this provides adequate but minimal behavioral context.

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

Conciseness5/5

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

The description is perfectly concise with two sentences that each earn their place: the first states the core purpose, the second specifies the exact return format. No wasted words, front-loaded with the essential information.

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

Completeness4/5

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

For a simple zero-parameter read tool with no output schema, the description provides the essential information: what it does and the exact return format. It could potentially mention that this is a common prerequisite for transaction construction, but given the tool's simplicity and lack of annotations/output schema, it's reasonably complete.

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?

With 0 parameters and 100% schema description coverage, the baseline would be 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the return value. No parameter information is needed or expected.

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 specific action ('Returns') and resource ('latest block hash from the ledger'), distinguishing it from sibling tools like get_block (which returns full block data) or get_block_height (which returns height rather than hash). The verb+resource combination is precise and unambiguous.

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 through the return format specification, suggesting this is for obtaining the most recent blockhash. However, it doesn't explicitly state when to use this versus alternatives like get_block (for full block data) or get_genesis_hash (for the initial blockhash). No explicit when/when-not guidance is provided.

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