Skip to main content
Glama

summ_get_tlh_opportunities

Read-only

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: false is a teaser: headline totals are real, but pools are empty and maxLossSell is null — relay upgradeNote instead 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

NameRequiredDescriptionDefault
contextYesWrite 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".
clientIdNoThe 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_modelYesThe 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.
currencyIdNoLot detail for one asset: the `opportunities[].currency.id` of a holding from a list call. Omit to list the top opportunities (no lot pools).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnly/non-destructive/no-open-world; the description adds substantial behavior beyond that: cached-price valuation, freshness bounded by `asOf`, a null-asOf precondition ('ask the user to refresh their report first'), and the `entitled: false` teaser semantics (real totals, empty pools, null maxLossSell, relay `upgradeNote` rather than inventing lot detail). The truncation counters (opportunitiesOmitted, unpricedOmitted, poolsOmitted, lotsOmitted) disclose that results are capped, which an agent must know to avoid reporting incomplete data as complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then cleanly sectioned into modes, compliance, and notes; the mode paragraph is dense but each clause carries distinct information. The compliance block is long and partly boilerplate about answer phrasing rather than tool invocation, which slightly dilutes an otherwise efficient, well-structured definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the full burden of explaining returns and does so: headline totals, per-item fields (maxLossSell, poolCount), what differs between list and detail mode (pools and lots present only in detail), and what omission counters mean. Combined with the freshness and entitlement states, an agent has everything needed to call it and interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline would be 3, but the description adds operational meaning the schema only hints at: `currencyId` is a mode switch (list vs detail), and it tells you where the value comes from ('the `opportunities[].currency.id` of a holding from a list call'). The two plumbing params (context, llm_model) are already fully documented in the schema, so no penalty there.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Find lot-aware tax loss harvesting opportunities from the user's latest tax report snapshot' — and immediately qualifies scope (latest snapshot, inventory method, per-wallet cost basis). It further distinguishes its own two modes (list without currencyId vs detail with currencyId), so an agent knows exactly what it returns before opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit precedence rule ('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') and names the follow-up alternative (summ_simulate_tlh for what-ifs, with the reason: same lot pools). It also names exclusions — 'Not for the user's actual realized tax position (get_tax_report) or current portfolio value (get_portfolio)' — which is exactly the when-not-to-use guidance the dimension asks for.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources