Skip to main content
Glama

get_recent_blockhash

Retrieve a recent blockhash to build valid transactions on the Solana blockchain, ensuring they are processed correctly by the network.

Instructions

Get recent blockhash for transaction building

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic: ensures connection and calls connection.getLatestBlockhash() to get the recent blockhash.
    async function handleGetRecentBlockhash() { ensureConnection(); const { blockhash } = await connection.getLatestBlockhash(); return { blockhash, network: currentNetwork }; }
  • Tool schema definition including name, description, and input schema (no required parameters). Part of the tools array used for listing tools.
    { name: "get_recent_blockhash", description: "Get recent blockhash for transaction building", inputSchema: { type: "object", properties: {} } },
  • src/index.ts:1315-1317 (registration)
    Dispatches the tool call to the handler function in the switch statement within the CallToolRequestSchema handler.
    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