Skip to main content
Glama

listLighthousePortfolios

Retrieve detailed information on all Lighthouse portfolios, including total portfolio value, associated wallets, and their individual balances for comprehensive crypto portfolio analysis.

Instructions

List all Lighthouse portfolios, their total portfolio value, the wallets within each portfolio and their total value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:60-95 (handler)
    Handler function that executes the listLighthousePortfolios tool. Fetches user portfolios, retrieves detailed data for each portfolio, calculates total portfolio value, formats the output listing each portfolio's name, total USD value, number of wallets, and wallet details.
    execute: async () => { const portfolios = await lighthouse.getUserData(); const porfolioData = await Promise.all( portfolios.user.portfolios.map(async (portfolio) => { return await lighthouse.getPortfolioData(portfolio.slug); }) ); //Sum the portfolios const totalPortfolioValue = porfolioData.reduce( (acc, data) => acc + data.usdValue, 0 ); /// Format the porfolio data const formattedPorfolioData = porfolioData.map((data, i) => { return `# ${i + 1}. ${ portfolios.user.portfolios[i].name }\n\n## Total Portfolio Value: $${data.usdValue.toLocaleString()}\n\n## Wallets (${ Object.keys(data.accounts).length }):\n${Object.entries(data.accounts) .map(([accountId, account]) => `- ${account.name} (${account.type})`) .join("\n")}`; }); return { content: [ { type: "text", text: `# Lighthouse Portfolios\n\n${formattedPorfolioData.join( "\n" )}\n\n## Total Portfolio Value: $${totalPortfolioValue.toLocaleString()}`, }, ], }; },
  • Zod schema for tool parameters: no parameters required.
    parameters: z.object({}),
  • index.ts:55-96 (registration)
    Registration of the listLighthousePortfolios tool with FastMCP server, specifying name, description, schema, and handler.
    server.addTool({ name: "listLighthousePortfolios", description: "List all Lighthouse portfolios, their total portfolio value, the wallets within each portfolio and their total value", parameters: z.object({}), execute: async () => { const portfolios = await lighthouse.getUserData(); const porfolioData = await Promise.all( portfolios.user.portfolios.map(async (portfolio) => { return await lighthouse.getPortfolioData(portfolio.slug); }) ); //Sum the portfolios const totalPortfolioValue = porfolioData.reduce( (acc, data) => acc + data.usdValue, 0 ); /// Format the porfolio data const formattedPorfolioData = porfolioData.map((data, i) => { return `# ${i + 1}. ${ portfolios.user.portfolios[i].name }\n\n## Total Portfolio Value: $${data.usdValue.toLocaleString()}\n\n## Wallets (${ Object.keys(data.accounts).length }):\n${Object.entries(data.accounts) .map(([accountId, account]) => `- ${account.name} (${account.type})`) .join("\n")}`; }); return { content: [ { type: "text", text: `# Lighthouse Portfolios\n\n${formattedPorfolioData.join( "\n" )}\n\n## Total Portfolio Value: $${totalPortfolioValue.toLocaleString()}`, }, ], }; }, });

Other Tools

Related Tools

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/l3wi/mcp-lighthouse'

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