Skip to main content
Glama

get_recent_blockhash

Retrieve the recent blockhash required to build and sign Solana transactions, ensuring they are processed on the blockchain.

Instructions

Get recent blockhash for transaction building

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'get_recent_blockhash' tool by calling connection.getLatestBlockhash() and returning the blockhash along with the current network.
    async function handleGetRecentBlockhash() { ensureConnection(); const { blockhash } = await connection.getLatestBlockhash(); return { blockhash, network: currentNetwork }; }
  • The schema definition for the 'get_recent_blockhash' tool, specifying its name, description, and empty input schema since no parameters are required.
    { name: "get_recent_blockhash", description: "Get recent blockhash for transaction building", inputSchema: { type: "object", properties: {} } },
  • src/index.ts:1315-1317 (registration)
    The registration/dispatch case in the tool call handler's switch statement that routes calls to the 'get_recent_blockhash' handler function.
    case "get_recent_blockhash": result = await handleGetRecentBlockhash(); break;

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/ExpertVagabond/solana-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server