Skip to main content
Glama

Roth vs Traditional Optimizer

Optimize Roth vs traditional contributions

optimize_retirement_contributions
Read-onlyIdempotent

Find the best yearly split of retirement savings between traditional and Roth 401(k), IRA/backdoor Roth, HSA and brokerage, including employer match, Roth conversions and retirement withdrawals. Returns this year's dollars per account, how the optimal mix compares with always-traditional and always-Roth, Roth share, lifetime totals, the first working years and retirement milestones. Runs in a few seconds (a few more with exact_income_limits). All money in today's dollars. Optimal for the stated assumptions; not tax advice. Call get_contribution_example first if unsure of the shape.

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": {
      "age": "<age>",
      "salary": "<salary>",
      "spending_in_retirement": "<spending_in_retirement>"
    },
    "name": "optimize_retirement_contributions"
  }
}

Input Schema

NameRequiredDescriptionDefault
ageYesYour age this year. The plan starts now.
filingNoTax filing status. Default 'single'. 'married' = one joint return; fill in the spouse_* fields.
salaryYesYour gross pay this year, in dollars.
end_ageNoPlan until this age (default 92; horizon at most 90 years).
accountsNoWhich accounts the user can use. Defaults: 401(k) and Roth 401(k) available, IRA allowed, no HSA, no match.
balancesNoCurrent household balances, dollars. Omitted = 0.
retire_ageNoAge you stop working. Must be above 'age'. Required unless find_earliest_retire_age is true.
assumptionsNoModeling assumptions; the defaults are reported back.
spouse_salaryNoMarried only: spouse's gross pay this year (0 or omitted = spouse does not work).
real_raise_pctNoYearly raise above inflation, whole percent (1 = 1%). Default 1.
social_securityNoExpected Social Security (household). Omitted = none modeled.
spouse_retire_ageNoMarried only: the age YOU will be when your spouse stops working (all ages on this server are the primary earner's). Default = retire_age.
children_birth_yearsNoBirth years of dependent children (child tax credit, head of household).
spending_in_retirementYesYearly spending after retiring, today's dollars (before income tax).
spending_while_workingNoYearly living costs while still working, today's dollars. Default = spending_in_retirement.
find_earliest_retire_ageNotrue = instead of using retire_age, find the EARLIEST age you can stop working and still fund spending_in_retirement every year to end_age, and return the optimal plan at that age. Married: the spouse keeps the gap between retire_age and spouse_retire_age if both are given. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / balances / properties / recent_conversions
      Added value: +{
      +  "description": "Roth conversions you made in the last 5 calendar years that are NOT yet penalty-free (this year and the 4 before). Each becomes penalty-free on Jan 1 five years after the year it was made; before 59.5 the plan only draws it penalty-free from then. Part of 'roth', not extra to it; with roth_penalty_free, cannot exceed 'roth'. Conversions only: contributions and older conversions go in roth_penalty_free. Default none.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "amount": {
      +        "description": "Dollars converted that year.",
      +        "minimum": 0,
      +        "type": "number"
      +      },
      +      "year": {
      +        "description": "Calendar year of the conversion (this year or one of the 4 before).",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "year",
      +      "amount"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 5,
      +  "type": "array"
      +}
    • addedInput schema / properties / balances / properties / roth_penalty_free
      Added value: +{
      +  "description": "Of the Roth balance, the part that can be withdrawn penalty-free before 59.5 (contributions and conversions at least 5 years old). Default 0; cannot exceed 'roth'. More recent conversions go in recent_conversions.",
      +  "minimum": 0,
      +  "type": "number"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / find_earliest_retire_age
      Added value: +{
      +  "description": "true = instead of using retire_age, find the EARLIEST age you can stop working and still fund spending_in_retirement every year to end_age, and return the optimal plan at that age. Married: the spouse keeps the gap between retire_age and spouse_retire_age if both are given. Default false.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / retire_age / description
      Previous value: -"Age you stop working. Must be above 'age'."New value: +"Age you stop working. Must be above 'age'. Required unless find_earliest_retire_age is true."
    • changedInput schema / required
      Previous value: -[
      -  "age",
      -  "salary",
      -  "retire_age",
      -  "spending_in_retirement"
      -]New value: +[
      +  "age",
      +  "salary",
      +  "spending_in_retirement"
      +]
  3. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the safety profile is covered; the description adds genuinely new behavior: runtime ("a few seconds," slower with exact_income_limits), unit convention ("All money in today's dollars"), and the optimality/caveat boundary ("not tax advice"). It also enumerates what the response contains, which matters because there is no output schema.

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 purpose is front-loaded in the first sentence, followed by return contents, runtime, units, and a caveat, all in dense sentences with little waste. The long return-value enumeration is justified by the absence of an output schema, though it could be tightened into a list for faster scanning.

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?

For a 16-parameter, deeply nested planning tool with no output schema, the description covers purpose, what comes back (per-account dollars, traditional/Roth comparison, Roth share, lifetime totals, milestones), runtime expectations, dollar convention, and a disclaiming caveat. An agent has everything needed to decide to call it and interpret the result.

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% and the schema already documents defaults, ranges, enums, and the match-tier semantics in detail, so the baseline is 3. The description adds almost no parameter-level meaning beyond what the schema states (the exact_income_limits cost note is already in the schema), so it neither compensates nor detracts.

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?

"Find the best yearly split of retirement savings between traditional and Roth 401(k), IRA/backdoor Roth, HSA and brokerage" names a specific verb (find the best split) and the exact resource set, plus the levers considered (employer match, Roth conversions, withdrawals). An agent can distinguish this optimization tool from get_contribution_example (a shape demo) without opening either schema.

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?

Gives a concrete prerequisite/routing hint: "Call get_contribution_example first if unsure of the shape," and frames the result as conditional ("Optimal for the stated assumptions; not tax advice"). It stops short of stating when NOT to use it or how it relates to check_request, so it is clear context without explicit exclusions.

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