menese_balance
Check native token balances across 19 blockchains including Ethereum, Solana, and Bitcoin to monitor cryptocurrency holdings.
Instructions
Get your native token balance on a specific blockchain.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Blockchain to check |
Implementation Reference
- src/tools/balance.ts:30-53 (handler)The handler function for menese_balance, which retrieves the native token balance for a specified chain.
async ({ chain }) => { const identity = store.get(); if (!identity) { return { content: [{ type: "text" as const, text: "No wallet configured. Use menese_setup first." }], isError: true }; } const result = await cacheFetch( CacheKeys.balance(identity.principal, chain), TTL.BALANCE, async () => { if (AUTH_CHAINS.includes(chain)) { return getChainBalanceAuthenticated(config, resolveActorIdentity(store), chain); } return getChainBalance(config, identity.principal, chain); }, ); return { content: [{ type: "text" as const, text: JSON.stringify(result, bigIntReplacer, 2), }], }; }, - src/tools/balance.ts:26-28 (schema)Input schema validation for the menese_balance tool, enforcing that the chain must be one of the supported chains.
inputSchema: { chain: z.enum(SUPPORTED_CHAINS as unknown as [string, ...string[]]).describe("Blockchain to check"), }, - src/tools/balance.ts:22-54 (registration)Tool registration for menese_balance within the MCP server.
server.registerTool( "menese_balance", { description: "Get your native token balance on a specific blockchain.", inputSchema: { chain: z.enum(SUPPORTED_CHAINS as unknown as [string, ...string[]]).describe("Blockchain to check"), }, }, async ({ chain }) => { const identity = store.get(); if (!identity) { return { content: [{ type: "text" as const, text: "No wallet configured. Use menese_setup first." }], isError: true }; } const result = await cacheFetch( CacheKeys.balance(identity.principal, chain), TTL.BALANCE, async () => { if (AUTH_CHAINS.includes(chain)) { return getChainBalanceAuthenticated(config, resolveActorIdentity(store), chain); } return getChainBalance(config, identity.principal, chain); }, ); return { content: [{ type: "text" as const, text: JSON.stringify(result, bigIntReplacer, 2), }], }; }, );