Skip to main content
Glama

finance_portfolio_tracker

Calculate portfolio value and allocation from holdings data to track financial investments and analyze asset distribution.

Instructions

Calculate portfolio value and allocation from a list of holdings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
holdingsYesComma-separated holdings: 'BTC:0.5,ETH:10,SOL:100' or 'AAPL:50,MSFT:30'

Implementation Reference

  • The implementation of the finance_portfolio_tracker tool, which parses a comma-separated list of holdings and returns a markdown table of the portfolio.
    server.tool("finance_portfolio_tracker", "Calculate portfolio value and allocation from a list of holdings", {
      holdings: z.string().describe("Comma-separated holdings: 'BTC:0.5,ETH:10,SOL:100' or 'AAPL:50,MSFT:30'")
    }, async ({ holdings }) => {
      const items = holdings.split(",").map(h => {
        const [asset, qty] = h.trim().split(":");
        return { asset: asset.trim(), qty: parseFloat(qty) || 0 };
      });
      const rows = items.map(i => [i.asset.toUpperCase(), i.qty.toString(), "Pending lookup", "Pending"]);
      return { content: [{ type: "text", text: `**Portfolio Tracker**\n\n${mdTable(["Asset", "Qty", "Price", "Value"], rows)}\n\n*Use crypto_price or finance_stock_price to look up individual prices, then calculate total.*` }] };
    });

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/ElromEvedElElyon/claw-mcp-toolkit'

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