Skip to main content
The AI advisor uses deterministic tools to query your real data. No numbers are made up — every figure in an answer is sourced from one of these tools running against your Supabase database.
Tools run server-side in Python. Claude Sonnet decides which tools to call based on your question. Independent tools run in parallel via asyncio.gather.

Cash Flow Tools

Fetches and summarises recent transactions.
ParameterTypeDefaultDescription
user_idstrAuthenticated user
daysint30Lookback window
categorystr""Filter to one category
limitint50Max rows returned
Returns: Total spend + breakdown by category as formatted text.Example Q: “How much did I spend on food last month?”
Fetches 30 days of transactions filtered to category Food. Returns total + individual transactions.
Fetches active budgets with month-to-date spend progress.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: Per-budget status: OK (< 80%), WARNING (80–100%), EXCEEDED (> 100%).Example Q: “Which budgets am I close to hitting?”
Returns all budgets with utilisation %. Flags any above 80%.
Detects recurring merchant charges from the last 90 days. Groups by merchant + amount, flags any with 2+ occurrences.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: List of {merchant, amount, occurrences, last_charge}.Example Q: “What subscriptions am I paying for?”
Returns Netflix 15.98×3,Spotify15.98 ×3, Spotify 9.90 ×3, iCloud $3.99 ×3, etc.
Projects month-end spending based on current daily burn rate.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: Per-category {budget, spent, projected, on_track}.Example Q: “Will I go over my food budget this month?”
Calculates daily spend rate, projects to month end, compares against budget limit.
Example questions handled by Cash Flow tools:
  • “How much did I spend on transport this week?”
  • “Show me my top 5 merchants this month”
  • “Compare my spending in February vs March”
  • “What’s my average monthly spend on groceries?”
  • “Am I on track with my budgets?”

Investment Tools

Fetches and summarises all investment holdings.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: Total portfolio value + breakdown by asset type (stocks, crypto, ETFs, etc.) with cost basis and current value.Example Q: “What’s my portfolio worth?”
Returns total market value, total cost basis, overall return %, allocation by asset type.
Fetches live market prices via yfinance (stocks/ETFs) or CoinGecko (crypto).
ParameterTypeDescription
symbolstrTicker (e.g. AAPL, BTC, ES3.SI)
Returns: {symbol, price, change_pct} with 24h change.Example Q: “What’s Apple trading at?”
Calls yfinance for real-time AAPL price + daily change %.
OHLCV historical price data via yfinance.
ParameterTypeDescription
symbolstrTicker symbol
periodstr1w, 1mo, 3mo, 6mo, 1y, max
Returns: OHLCV series + period return %.Example Q: “How has Tesla performed over the last 6 months?”
Fetches 6-month OHLCV, calculates period return, returns sparkline data.
Example questions handled by Investment tools:
  • “What’s my best performing holding this month?”
  • “How diversified is my portfolio?”
  • “What’s the P&L on my crypto positions?”
  • “Show me my allocation breakdown”
  • “Is MSFT up or down today?”

Debt Tools

Fetches interpersonal debts — what you owe friends and what they owe you.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: Net debt position + individual debt breakdown (creditor/debtor, amount, currency, status).Example Q: “Who owes me money?”
Lists all unsettled debts where user is creditor, with amounts and names.
Example questions handled by Debt tools:
  • “What’s my total credit card utilisation?”
  • “If I pay an extra $200/month towards my loan, when will I be debt-free?”
  • “How much do I owe across all my friends?”
  • “What’s my debt-to-income ratio?”

Wealth Tools

Runs the full anomaly detection pipeline: z-score category analysis, duplicate charge detection, and budget threshold checks.
ParameterTypeDescription
user_idstrAuthenticated user
Returns: List of {type, severity, message, metadata} alerts.Alert types: high_spend, duplicate, budget_warning, budget_exceeded.Example Q: “Are there any unusual charges on my account?”
Runs z-score analysis on last 90 days. Returns any categories >2σ above weekly mean + duplicate charge pairs.
Example questions handled by Wealth tools:
  • “What’s my current net worth?”
  • “How has my net worth changed over the last 6 months?”
  • “What’s my savings rate this year?”
  • “Show me my assets vs liabilities”
  • “Any suspicious charges this month?”

Market Tools

Single stock/ETF price with daily change via yfinance. Cached with 60-second TTL.
ParameterTypeDescription
symbolstrYahoo Finance ticker (e.g. AAPL, ES3.SI, BTC-USD)
Returns: {symbol, price, change_pct}.
Single crypto price from CoinGecko API. Cached with 60-second TTL.
ParameterTypeDescription
coin_idstrCoinGecko ID (e.g. bitcoin, ethereum, solana)
Returns: {id, price_usd, change_24h}.
Example questions handled by Market tools:
  • “What’s Bitcoin trading at?”
  • “How did the S&P 500 do today?”
  • “Compare AAPL vs MSFT performance this year”
  • “What’s the SGD/USD rate?”

How tools are called

When you ask a question, the specialist (Claude Sonnet) receives your question, conversation history, and the full list of tools for your domain. It decides which tools to call — often multiple in parallel:
You: "How much did I spend on food vs my budget, and are there any subscriptions I forgot about?"

Claude calls simultaneously:
  → query_transactions(days=30, category="Food")
  → get_budgets()
  → scan_subscriptions()

All three results return → Claude synthesises into one answer
The Flutter chat UI shows each tool call as it fires: “Analyzing food transactions… Checking budgets… Scanning for subscriptions…”