Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_genesis_hash

Retrieve the genesis hash for the Solana blockchain to validate network integrity or initialize connections. This tool provides the hash in a formatted string 'Genesis hash: {hash}', essential for blockchain interactions.

Instructions

Returns the genesis hash.

Returns: str: Genesis hash in the format "Genesis hash: {hash}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_genesis_hash' MCP tool. It is registered via the @mcp.tool() decorator and fetches the genesis hash from the Solana RPC client using AsyncClient, formatting the response as a string.
    @mcp.tool() async def get_genesis_hash() -> str: """Returns the genesis hash. Returns: str: Genesis hash in the format "Genesis hash: {hash}" """ async with AsyncClient(rpc_url) as client: hash = await client.get_genesis_hash() return f"Genesis hash: {hash}"
  • src/server.py:141-141 (registration)
    The @mcp.tool() decorator registers the get_genesis_hash function as an MCP tool.
    @mcp.tool()

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