fetch_portfolios
List or search your portfolios with lightweight metadata (strategy id + name). Matches portfolio name, strategy names, and tickers — same workspace search as the dashboard / GET /api/chat-portfolio. include_chat_portfolios returns workspace DRAFTS only (excludes deployedMirror rows). Recover a past chat draft: include_paper=false, include_live=false, include_chat_portfolios=true, search="Delta 0.07" (then get_portfolio for full strategy JSON). Returns an object: { portfolios, page, limit, total, totalPages, scopes }. Deployed and draft rows page as one list (all deployed, then all drafts), so every row is reachable by walking pages. When search is set, include_positions defaults to false. Use analyze_portfolios only when you need LLM-written analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (default 1) | |
| limit | No | Max portfolios to return (default 20, max 50) | |
| search | No | Free-text search (max 100 chars) over portfolio name, strategy names, and tickers, ranked by relevance. Matches stemmed whole words (Postgres full-text) and case-insensitive substrings of 3+ characters (so prefixes like "neckb" find "Neckbeard"). Omit for list/paginate mode. Matches the dashboard workspace search — not condition-field values. | |
| include_live | No | Include live trading portfolios (default true) | |
| include_paper | No | Include paper portfolios (default true) | |
| portfolio_ids | No | Specific portfolio IDs to fetch (omit for all) | |
| include_inactive | No | Include inactive portfolios (default true) | |
| include_positions | No | Include positions + spread-grouped holdings (default true when not searching; default false when search is set). cash and buyingPower are always returned for deployed portfolios regardless of this flag. | |
| include_chat_portfolios | No | Include workspace draft chat portfolios (default false). Excludes deployedMirror. Set true with include_paper=false and include_live=false for draft-only search. |