block_info
Retrieve detailed information about a specific Nano blockchain block by providing its hash, enabling precise data analysis and transaction verification.
Instructions
Retrieve detailed information about a specific Nano block.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | Hash for the Nano block to get information about |
Implementation Reference
- nano-currency.js:313-340 (handler)The handler function that fetches block information via RPC call to 'block_info', processes the amount and balance with friendlyAmount, and returns a formatted text response. Handles errors appropriately.async function (parameters) { try { let blockInfoJson = ( await rpcCall( NANO_RPC_URL_KEY, 'block_info', { json_block: 'true', hash: parameters.hash } ) ) return createTextResponse( `The block information for hash ${parameters.hash} is ` + JSON.stringify({ ...blockInfoJson, amount: blockInfoJson.amount ? friendlyAmount(blockInfoJson.amount) : 'N/A', balance: blockInfoJson.balance ? friendlyAmount(blockInfoJson.balance) : 'N/A' }) ) } catch (error) { console.error('[block_info] Error:', error.message || error); return createErrorResponse(error) } }
- nano-currency.js:303-307 (schema)Zod schema for the block_info tool parameters, validating the required 'hash' string parameter.const block_info_parameters = { hash: z.string({ required_error: 'Block hash is required' }) .refine(hash_ => N.checkHash(hash_), { message: 'Block hash is not valid' }) .describe("Hash for the Nano block to get information about") }
- nano-currency.js:309-312 (registration)Registers the 'block_info' tool on the MCP server with its name, description, schema, and references the inline handler function.server.tool( 'block_info', 'Retrieve detailed information about a specific Nano block.', block_info_parameters,