Skip to main content
Glama

Tax-Loss Harvest Candidates

tax_loss_harvest_candidates
Read-onlyIdempotent

Positions sitting at an unrealized loss in a pasted positions export, largest loss first, with the total; given a transactions export too, flags any bought in the last 30 days (wash-sale risk on a sale). Example questions: "What can I tax-loss harvest?"; "Which of my positions are losers?"; "Any losses to offset my gains this year?"

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": {
      "positions_csv": "<positions_csv>"
    },
    "name": "tax_loss_harvest_candidates"
  }
}

Input Schema

NameRequiredDescriptionDefault
positions_csvYesThe positions/portfolio CSV from the broker, pasted as text (symbol, quantity, market value or last price; a gain or cost-basis column for gains and losses)
transactions_csvNoThe transactions or gains/losses CSV from the broker, pasted as text (E*TRADE download, this repo's CSV, or plain columns date, action, symbol, quantity, price, fee). Optional: flags recent buys for the 30-day rule

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description correctly focuses on added behavior: output ordering (largest loss first), inclusion of a total, and conditional wash-sale flagging tied to the 30-day rule. It does not describe pagination, limits on export size, or error handling for malformed pasted CSV, which are the remaining behavioral gaps.

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?

The tool's core behavior is front-loaded in one dense sentence covering source, ordering, total, and the optional wash-sale enhancement. The trailing example questions are compact and aid routing, though they partially restate the opening sentence, so the definition is slightly longer than strictly necessary.

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

Completeness4/5

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

With only two fully documented parameters, no output schema, and complete annotations, the description provides enough to call the tool correctly and anticipate the shape of the result (ranked losses plus a total, with wash-sale flags). What remains unstated is how malformed or partial pasted CSV is handled and how many rows are returned.

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 the baseline is 3, but the description goes further by tying each parameter to a behavior: positions_csv must carry a gain or cost-basis column for losses to be computed, and transactions_csv is what enables the 30-day recent-buy flag. That causal link between input and output is meaning the schema alone does not convey.

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?

The description states exactly what is produced: positions at an unrealized loss from a pasted positions export, ordered largest loss first, with a total, plus 30-day wash-sale flagging when a transactions export is supplied. That is specific enough to separate it from siblings like realized_pnl and wash_sale_check, which deal with closed trades and individual trade checks rather than a ranked open-position loss list.

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

Usage Guidelines4/5

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

Three example questions ('What can I tax-loss harvest?', 'Which of my positions are losers?', 'Any losses to offset my gains this year?') give concrete invocation contexts, and the description explains the effect of supplying the optional transactions export. It stops short of stating when NOT to use this tool or naming an alternative such as wash_sale_check, so no exclusion guidance is present.

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.