crypto_portfolio
Track real-time cryptocurrency portfolio values using CoinGecko data to monitor investment performance and make informed decisions.
Instructions
Get real-time crypto portfolio value from CoinGecko (no fake numbers)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coins | No | Comma-separated coin IDs (default: bitcoin,ethereum,solana) | bitcoin,ethereum,solana |
Implementation Reference
- src/index.ts:462-475 (handler)The 'crypto_portfolio' tool handler, which fetches cryptocurrency prices using 'getCryptoPrice' and formats the output.
case "crypto_portfolio": { const coins = ((args as any).coins || "bitcoin,ethereum,solana").split(","); const results: string[] = []; for (const coin of coins) { const data = getCryptoPrice(coin.trim()); if (data && data[coin.trim()]) { const d = data[coin.trim()]; results.push(`${coin.trim().toUpperCase()}: $${d.usd?.toLocaleString()} (${d.usd_24h_change?.toFixed(2)}%) — MCap: $${(d.usd_market_cap / 1e9).toFixed(1)}B`); } } return { content: [{ type: "text", text: results.join("\n") || "Unable to fetch prices" }], }; } - src/index.ts:317-326 (registration)Registration of the 'crypto_portfolio' tool within the MCP server definition.
{ name: "crypto_portfolio", description: "Get real-time crypto portfolio value from CoinGecko (no fake numbers)", inputSchema: { type: "object" as const, properties: { coins: { type: "string", description: "Comma-separated coin IDs (default: bitcoin,ethereum,solana)", default: "bitcoin,ethereum,solana" }, }, }, },