Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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") }],
      };
    },
  • 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: {},
      },

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/Aboodtt404/mcp-menesesdk'

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