Problem
get_positions returns all ~40 positions every time, which eats significant context window in LLM workflows — even when you only care about a subset.
Proposed Solution
Add an optional filter query param to get_positions:
losers_only — return only positions with negative P&L (tax-loss harvesting, "what's on sale")
winners_only — return only positions with positive P&L
all — current behavior (default, backwards compatible)
Example Usage
GET /positions?filter=losers_only
Why
For common portfolio analysis tasks (tax-loss harvesting, reviewing underperformers), this cuts the response from ~40 positions to ~10-12 — a ~70% reduction in context usage with no loss of relevant data.
Notes
Problem
get_positionsreturns all ~40 positions every time, which eats significant context window in LLM workflows — even when you only care about a subset.Proposed Solution
Add an optional
filterquery param toget_positions:losers_only— return only positions with negative P&L (tax-loss harvesting, "what's on sale")winners_only— return only positions with positive P&Lall— current behavior (default, backwards compatible)Example Usage
Why
For common portfolio analysis tasks (tax-loss harvesting, reviewing underperformers), this cuts the response from ~40 positions to ~10-12 — a ~70% reduction in context usage with no loss of relevant data.
Notes
allto maintain backwards compatibility