menese_portfolio
Retrieve your complete cryptocurrency portfolio across 19 blockchains including EVM, Solana, Bitcoin, and ICP ecosystem tokens with a configured wallet.
Instructions
Get your full portfolio across all 19 supported blockchains (EVM, Solana, Bitcoin, ICP, etc.) plus ICP ecosystem tokens (ckBTC, ckETH, ckUSDC). Requires a configured wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/portfolio.ts:48-117 (handler)Handler function for the menese_portfolio tool, which retrieves portfolio data across multiple chains and ICP ecosystem tokens.
async () => { const identity = store.get(); if (!identity) { return { content: [{ type: "text" as const, text: "No wallet configured. Use menese_setup first." }], isError: true }; } const portfolio = await cacheFetch( CacheKeys.portfolio(identity.principal), TTL.PORTFOLIO, async () => { const seedOrId = resolveActorIdentity(store); const [native, icrc1] = await Promise.all([ getPortfolio(config, identity.principal, seedOrId), getAllICRC1Balances(config, seedOrId), ]); return { native, icrc1Tokens: icrc1 }; }, ); const lines: string[] = []; // Native balances if (portfolio.native.ok) { const { data: balances, errors } = portfolio.native; if (balances.length > 0) { lines.push("## Portfolio Balances\n"); for (const b of balances) { lines.push(`- ${formatBalance(b)}`); } } else { lines.push("## Portfolio Balances\n"); lines.push("No balances found across supported chains."); } // Categorize errors if (errors && errors.length > 0) { const subRequired = errors.filter(e => isSubscriptionError(e.error)); const other = errors.filter(e => !isSubscriptionError(e.error)); if (subRequired.length > 0) { const chains = subRequired.map(e => CHAIN_LABEL[e.chain] ?? e.chain).join(", "); lines.push(`\n## Subscription Required\n`); lines.push(`${chains} — balance queries require a Menese subscription.`); lines.push(`Upgrade at https://menese.io to unlock full multi-chain access.`); } if (other.length > 0) { lines.push(`\n## Unavailable Chains\n`); for (const e of other) { lines.push(`- ${CHAIN_LABEL[e.chain] ?? e.chain}: ${e.error}`); } } } } else { lines.push(`Portfolio fetch failed: ${portfolio.native.error}`); } // ICRC-1 tokens (ckBTC, ckETH, ckUSDC, etc.) if (Array.isArray(portfolio.icrc1Tokens) && portfolio.icrc1Tokens.length > 0) { lines.push(`\n## ICP Ecosystem Tokens\n`); for (const t of portfolio.icrc1Tokens) { lines.push(`- ${t.symbol}: ${t.balance}`); } } return { content: [{ type: "text" as const, text: lines.join("\n") }], }; }, - src/tools/portfolio.ts:40-47 (registration)Registration of the menese_portfolio tool.
server.registerTool( "menese_portfolio", { description: "Get your full portfolio across all 19 supported blockchains (EVM, Solana, Bitcoin, ICP, etc.) " + "plus ICP ecosystem tokens (ckBTC, ckETH, ckUSDC). Requires a configured wallet.", inputSchema: {}, },