Opportunity Cost Calculator
calculate_opportunity_costCalculation, not advice. Verify with a professional before acting. Calculate the true cost of recurring spending by showing what that money would be worth if invested. Pick this when the input is recurring spending. Pick calculate_compound_interest when the input is a balance and its contributions with no spending to price, and compare_payoff_vs_invest when the alternative to investing is paying down debt. The response includes chart_hints with rendering directives any client can use.
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": {
"monthly_spending": "<monthly_spending>",
"annual_return_pct": "<annual_return_pct>",
"years": "<years>"
},
"name": "calculate_opportunity_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | What the spending is, e.g. 'coffee' or 'streaming subscriptions'. Optional. Max 120 characters. | |
| years | Yes | Time horizon in years. Integer, greater than 0. REQUIRED, no default. | |
| tax_year | No | Tax year, 2025 or 2026. Year 1 of the horizon, so the assumed sale of the investments falls in tax year tax_year + years - 1. Optional; defaults to 2026 when omitted. | |
| chart_title | No | Override for the chart title. Must not contain em-dashes or en-dashes. Max 120 characters. Optional. | |
| filing_status | No | Tax filing status: 'single', 'married', or 'head_of_household'. Optional; matched case-insensitively. Required, with annual_gross_income, for the after-tax opportunity cost. | |
| tax_bracket_pct | No | Not used. Kept so older calls still work; an after-tax figure needs filing_status and annual_gross_income. Decimal from 0 to 100. Optional. | |
| monthly_spending | Yes | Monthly spending to price against investing. Decimal, at least $0.01. The opportunity cost of spending $0 is degenerate and is rejected. REQUIRED, no default. | |
| annual_return_pct | Yes | Effective annual investment return, e.g. 8 not 0.08; the monthly compounding step is (1+pct/100)^(1/12)-1. Decimal from 0 to 100. REQUIRED, no default. | |
| annual_gross_income | No | Annual gross income in dollars, used as adjusted gross income for the tax on investment gains at the horizon. Optional; with filing_status it enables the after-tax opportunity cost. Held at this amount in the year of the assumed investment sale. Must be zero or more and no more than $1,000,000,000. |