summ_get_tlh_opportunities
Find lot-aware tax loss harvesting opportunities from the user's latest tax report snapshot, honouring their inventory method (FIFO/LIFO/HIFO/average-cost) and per-wallet cost-basis tracking.
Two modes. Without currencyId (list call): the top opportunities by harvestable loss (biggest first), each with maxLossSell (the sale that would realize the largest loss) and poolCount but NO lot pools, plus the largest unpriced (likely dead/spam) assets and settings. With currencyId (detail call): only that holding as opportunity, with its wallet pools (maxLossSell wallet first) and lots in the method's exact sell order. Headline totals are totalHarvestableLoss, opportunityCount and unpricedCount, over all rows. Lists are capped: opportunitiesOmitted, unpricedOmitted, poolsOmitted and lotsOmitted count what is not shown.
Call it FIRST whenever the user asks about tax loss harvesting, realizing losses, reducing tax before year end, or dead/worthless coins — never answer such questions from other tools or prose. For what-ifs ("what if I sold half?"), follow up with summ_simulate_tlh: it consumes the same lot pools, so the numbers line up.
COMPLIANCE (applies to every reply built on this data): state facts and conditionals only — never advise, never say "you should" or call anything a "suggestion" (present maxLossSell as "the sale that would realize the largest loss"). Any tax-saving figure you derive must be labelled a rough estimate (≈) — information, not financial or tax advice.
Notes:
All amounts are in the user's local currency, valued at cached market prices.
Data freshness is bounded by the last completed report refresh (
asOf); null asOf means no snapshot exists yet — ask the user to refresh their report first.entitled: falseis a teaser: headline totals are real, but pools are empty and maxLossSell is null — relayupgradeNoteinstead of inventing lot detail.Not for the user's actual realized tax position (get_tax_report) or current portfolio value (get_portfolio).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"context": "<context>",
"llm_model": "<llm_model>"
},
"name": "summ_get_tlh_opportunities"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | Write one short, abstract, third-person sentence about the task. Refer to the requester only as "the user". Refer to any selected customer, client profile, business, portfolio, account, or data source only as "the client". Never copy, abbreviate, initialize, quote, or paraphrase a user or client name from the conversation, request, or tool data. Never put a name, initials, label, possessive name, business name, email, account name, or identifier before or after "the user" or "the client". Rewrite every named reference to exactly "the user" or "the client". For example, rewrite "User wants to know the inventory method for the client Alex R" as "The user wants to know the inventory method for the client." Do not include wallet names, wallet addresses, transaction hashes, amounts, balances, prices, dates, tax identifiers, account identifiers, or other personal or financial values. Use only generic data categories such as "transactions", "accounts", "wallets", or "tax settings". If a safe abstract summary is not possible, write exactly "the request contains sensitive details". | |
| clientId | No | The client this call acts for — its ID comes from list_clients. Accountants and collaborators: set it on every client-scoped call to operate on that client's data. Only accountant/collaborator accounts have clients; individual accounts omit it. | |
| llm_model | Yes | The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess. | |
| currencyId | No | Lot detail for one asset: the `opportunities[].currency.id` of a holding from a list call. Omit to list the top opportunities (no lot pools). |