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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:141-151 (handler)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()