Skip to main content
Glama

Senaro Personal Finance

Opportunity Cost Calculator

calculate_opportunity_cost
Read-onlyIdempotent

Calculation, 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

NameRequiredDescriptionDefault
labelNoWhat the spending is, e.g. 'coffee' or 'streaming subscriptions'. Optional. Max 120 characters.
yearsYesTime horizon in years. Integer, greater than 0. REQUIRED, no default.
tax_yearNoTax 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_titleNoOverride for the chart title. Must not contain em-dashes or en-dashes. Max 120 characters. Optional.
filing_statusNoTax 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_pctNoNot 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_spendingYesMonthly 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_pctYesEffective 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_incomeNoAnnual 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / annual_gross_income
      Added value: +{
      +  "default": null,
      +  "description": "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.",
      +  "maximum": 1000000000,
      +  "minimum": 0,
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / filing_status
      Added value: +{
      +  "default": null,
      +  "description": "Tax filing status: 'single', 'married', or 'head_of_household'. Optional; matched case-insensitively. Required, with annual_gross_income, for the after-tax opportunity cost.",
      +  "enum": [
      +    "single",
      +    "married",
      +    "head_of_household",
      +    null
      +  ],
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / tax_bracket_pct / description
      Previous value: -"Tax bracket as a percentage, applied as a flat haircut to the investment gain. Decimal from 0 to 100. Optional."New value: +"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."
    • addedInput schema / properties / tax_year
      Added value: +{
      +  "default": null,
      +  "description": "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.",
      +  "maximum": 2026,
      +  "minimum": 2025,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / chart_title / maxLength
      Added value: +120
    • changedInput schema / properties / label / description
      Previous value: -"What the spending is, e.g. 'coffee' or 'streaming subscriptions'. Optional."New value: +"What the spending is, e.g. 'coffee' or 'streaming subscriptions'. Optional. Max 120 characters."
    • addedInput schema / properties / label / maxLength
      Added value: +120
    • addedInput schema / properties / monthly_spending / minimum
      Added value: +0.01
  3. Changed8 schema fields changed
    • addedInput schema / properties / annual_return_pct
      Added value: +{
      +  "description": "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.",
      +  "type": "number"
      +}
    • addedInput schema / properties / chart_title
      Added value: +{
      +  "default": null,
      +  "description": "Override for the chart title. Must not contain em-dashes or en-dashes. Max 120 characters. Optional.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / label
      Added value: +{
      +  "default": null,
      +  "description": "What the spending is, e.g. 'coffee' or 'streaming subscriptions'. Optional.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / monthly_spending
      Added value: +{
      +  "description": "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.",
      +  "type": "number"
      +}
    • addedInput schema / properties / tax_bracket_pct
      Added value: +{
      +  "default": null,
      +  "description": "Tax bracket as a percentage, applied as a flat haircut to the investment gain. Decimal from 0 to 100. Optional.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • removedInput schema / properties / toolArguments
      Removed value: -{
      -  "description": "JSON object with these parameters:\n\nmonthly_spending: decimal, at least 0.01 (REQUIRED). The opportunity cost of spending $0 is degenerate and is rejected.\nannual_return_pct: decimal 0-100 as percentage, e.g. 8 not 0.08, an EFFECTIVE ANNUAL rate; the monthly compounding step is (1+pct/100)^(1/12)-1 (REQUIRED)\nyears: int > 0 (REQUIRED)\nlabel: string (optional). e.g. 'coffee' or 'streaming subscriptions'\ntax_bracket_pct: decimal 0-100 (optional)\nchart_title: string (optional) override for the chart title. Must not contain em-dashes or en-dashes. Max 120 characters."
      -}
    • addedInput schema / properties / years
      Added value: +{
      +  "description": "Time horizon in years. Integer, greater than 0. REQUIRED, no default.",
      +  "type": "integer"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "toolArguments"
      -]New value: +[
      +  "monthly_spending",
      +  "annual_return_pct",
      +  "years"
      +]
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds a liability disclaimer ('Calculation, not advice. Verify with a professional before acting') and discloses that the response carries chart_hints rendering directives, which is useful context beyond the annotations. It does not elaborate further on output shape or edge-case handling, so it falls short of a 5.

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?

Sentences are front-loaded with purpose and disclaimer, followed by routing guidance and an output note. Every sentence carries distinct information with no filler.

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?

For a stateless calculation tool with a fully documented schema and read-only annotations, the description covers purpose, routing, and output hint sufficiently. It mentions chart_hints but does not describe the numeric return shape, which leaves a small gap given there is no output schema.

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 description coverage is 100%, so the schema already documents all nine parameters, including the conditional after-tax inputs and the deprecated tax_bracket_pct. The description adds no parameter-level syntax or defaults beyond what the schema provides, so the baseline 3 applies.

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 a specific verb and resource ('Calculate the true cost of recurring spending by showing what that money would be worth if invested') and explicitly distinguishes itself from two named siblings. An agent can tell it apart from calculate_compound_interest and compare_payoff_vs_invest without opening any 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?

It gives an explicit selection rule ('Pick this when the input is recurring spending') plus two named alternatives with the exact conditions that route to each (balance+contributions vs. debt payoff). Nothing is left to inference.

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