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}"

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