set_portfolio_context
Provide your cryptocurrency portfolio holdings to receive personalized financial guidance and analysis from Fathom's intelligence tools.
Instructions
Save your portfolio holdings so Fathom can give personalized guidance. Pass an array of holdings with asset name and amount. Example: [{asset: "bitcoin", amount: 2}, {asset: "solana", amount: 50}, {asset: "usdc", amount: 10000}].
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holdings | Yes | Array of portfolio holdings |
Implementation Reference
- src/tools/set-portfolio-context.ts:16-26 (handler)The implementation of the `set_portfolio_context` tool, which calls `setPortfolio` and returns a result with agent guidance.
export function setPortfolioContext(holdings: PortfolioHolding[]): SetPortfolioResult { const portfolio = setPortfolio(AGENT_ID, holdings); return { success: true, agent_id: AGENT_ID, holdings_count: holdings.length, updated_at: portfolio.updated_at, agent_guidance: `Portfolio context saved with ${holdings.length} position${holdings.length === 1 ? '' : 's'}. Call get_portfolio_analysis to receive personalized guidance based on current market conditions. Call get_reality_check to see how your portfolio aligns with the current regime.`, }; } - The interface definition for the result returned by `set_portfolio_context`.
export interface SetPortfolioResult { success: boolean; agent_id: string; holdings_count: number; updated_at: string; agent_guidance: string; } - src/index.ts:226-226 (registration)Registration/invocation of the tool in the main index file.
const result = setPortfolioContext(holdings);