Skip to main content
Glama
kilkelly

Nano Currency MCP Server

by kilkelly

nano_my_account_info

Retrieve detailed Nano account information including balance, representative, and frontier block for the address used to send Nano.

Instructions

Retrieve detailed information about my Nano account/address, including balance (in Nano and raw units), representative, and frontier block. This is the account that is used to send Nano from.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'nano_my_account_info' tool. It validates the NANO_PRIVATE_KEY, derives the account address using getAddress(), fetches account info via getAccountInfo(), formats the balance with friendlyAmount(), and returns a formatted text response.
    async function () { try { NANO_PRIVATE_KEY_SCHEMA.parse(process.env.NANO_PRIVATE_KEY) const myAddress = getAddress() let myAccountInfo = await getAccountInfo(myAddress) return createTextResponse(`The account information for ${myAddress} is ` + JSON.stringify({ ...myAccountInfo, balance: friendlyAmount(myAccountInfo.balance) })) } catch (error) { console.error('[nano_my_account_info] Error:', error.message || error); return createErrorResponse(error) } }
  • Registration of the 'nano_my_account_info' tool using server.tool(), including the tool name, description, empty parameters schema ({}), and the handler function.
    server.tool( 'nano_my_account_info', 'Retrieve detailed information about my Nano account/address, including balance (in Nano and raw units), representative, and frontier block. This is the account that is used to send Nano from.', {}, async function () { try { NANO_PRIVATE_KEY_SCHEMA.parse(process.env.NANO_PRIVATE_KEY) const myAddress = getAddress() let myAccountInfo = await getAccountInfo(myAddress) return createTextResponse(`The account information for ${myAddress} is ` + JSON.stringify({ ...myAccountInfo, balance: friendlyAmount(myAccountInfo.balance) })) } catch (error) { console.error('[nano_my_account_info] Error:', error.message || error); return createErrorResponse(error) } } )
  • Zod schema used within the handler to validate the NANO_PRIVATE_KEY environment variable.
    const NANO_PRIVATE_KEY_SCHEMA = z.string({ required_error: `NANO_PRIVATE_KEY is required`, }) .refine(val => N.checkKey(val), { message: `NANO_PRIVATE_KEY is not valid` })
  • Helper function called by the handler to fetch detailed account information from the Nano RPC endpoint.
    async function getAccountInfo(address) { return ( await rpcCall( NANO_RPC_URL_KEY, 'account_info', { account: address, representative: 'true' } ) ) }
  • Helper function used by the handler to derive the Nano address from the private key.
    function getAddress () { return N.deriveAddress(N.derivePublicKey(process.env.NANO_PRIVATE_KEY), { useNanoPrefix: true }) }

Other Tools

Related Tools

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/kilkelly/nano-currency-mcp-server'

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