Skip to main content
Glama
irs-taxpayer-mcp

irs-taxpayer-mcp

by dma9527

optimize_capital_gains

Read-onlyIdempotent

Suggest which investment lots to sell to minimize capital gains tax. Analyzes holding periods, tax brackets, loss harvesting, and wash sale rules.

Instructions

Analyze investment lots and suggest which to sell to minimize tax. Considers long-term vs short-term, 0% bracket space, loss harvesting, and wash sale rules.

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": {
      "taxYear": "<taxYear>",
      "filingStatus": "<filingStatus>",
      "ordinaryIncome": "<ordinaryIncome>",
      "lots": "<lots>"
    },
    "name": "optimize_capital_gains"
  }
}

Input Schema

NameRequiredDescriptionDefault
lotsYesInvestment lots to analyze
taxYearYesTax year
filingStatusYes
ordinaryIncomeYesOrdinary income (W-2, SE, interest, etc.) before investment sales
targetGainOrLossNoTarget net gain/loss to realize (negative for harvesting losses)

Output Schema

NameRequiredDescriptionDefault
textYes
errorNo
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.2.4
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / lots / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / lots / items / properties / holdingMonths / maximum
      Added value: +9007199254740991
  2. Changed1 schema field changedv1.0.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "suggestion": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "message",
      +        "suggestion"
      +      ],
      +      "type": "object"
      +    },
      +    "isError": {
      +      "type": "boolean"
      +    },
      +    "text": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "text",
      +    "isError"
      +  ],
      +  "type": "object"
      +}
  3. First observedv0.5.3

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, closed-world, non-destructive behavior, so the safety profile is covered. The description adds genuine domain context by enumerating the analysis factors (LT vs ST, 0% bracket space, loss harvesting, wash sale rules), which tells the agent how the recommendation is derived. It stops short of stating assumptions or limitations, e.g. whether the wash-sale check requires prior-trade data the schema does not accept.

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

Conciseness5/5

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

Two sentences, both earning their place: the first states the action and outcome, the second enumerates the factors considered. Front-loaded and free of filler.

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

Completeness3/5

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

An output schema exists, so return values need no explanation, and the factor list covers the domain logic. However, the description claims wash sale rule handling while the input schema exposes no field for recent purchases or prior trades, leaving an agent unsure whether that check is actually performed or relies on data it must not supply.

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

Parameters3/5

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

Schema coverage is 80%, so the baseline is 3 and the schema already documents almost every field. The description loosely maps concepts to parameters — '0% bracket space' implies ordinaryIncome and filingStatus, 'long-term vs short-term' implies holdingMonths, 'harvesting losses' implies negative targetGainOrLoss — but adds no format or constraint detail beyond that.

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

Purpose4/5

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

The description uses a specific verb-plus-resource pair ('Analyze investment lots and suggest which to sell') and states the goal (minimize tax). It is clearly distinct from siblings like simulate_tax_scenario or plan_retirement_withdrawals, though it never explicitly names a near-neighbor to rule out.

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

Usage Guidelines3/5

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

Usage is only implied: 'suggest which to sell to minimize tax' tells the agent this is a what-if planning call, not an execution call. There is no explicit when-to-use vs. when-not, and no pointer to an alternative such as plan_multi_year_taxes when the decision spans multiple years.

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