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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:798-806 (handler)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 }; }
- src/index.ts:240-247 (schema)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;