Skip to main content
Glama

401k.loans: 401(k) loan and withdrawal calculators

True cost of a 401(k) loan

calculate_401k_loan_cost
Read-onlyIdempotent

Runs the 401k.loans true-cost calculator: payment per paycheck and number of payments, total repaid and interest, pre-tax pay needed per payment, tax later on the interest, the 401(k) balance at payoff with and without the loan (growth gap) and that gap at 65, the legal and usual plan borrowing limits, and, if you might leave the job, the balance owed then plus the tax and 10% additional tax if it is not repaid or rolled over.

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": {
      "vested_balance": "<vested_balance>",
      "loan_amount": "<loan_amount>"
    },
    "name": "calculate_401k_loan_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
ageNoYour age today, 18 to 80. Default 40.
yearsNoYears to repay: 1 to 5, or 10 or 15 for a loan to buy your main home. Default 5.
loan_amountYesAmount to borrow in dollars, e.g. 15000.
pay_frequencyNoHow often you are paid (one loan payment per paycheck). Default biweekly.biweekly
plan_rate_pctNoPlan loan interest rate in percent, 0 to 20. Default: the prime rate plus 1 point, as an example; the real rate is on your plan's loan paperwork.
state_tax_pctNoState income tax rate in percent, 0 to 15. Default 0.
vested_balanceYesVested 401(k) balance in dollars, e.g. 60000.
assumed_return_pctNoAnnual return you assume the 401(k) would earn, in percent (-20 to 20). An assumption, not a forecast. Default 6.
federal_bracket_pctNo2026 federal income tax bracket in percent (Rev. Proc. 2025-32): 10, 12, 22, 24, 32, 35 or 37.
leave_job_after_monthsNoModel leaving the job after this many months (0 = do not model it). Default 24, as on the page.
lost_match_per_paycheckNoEmployer match you would lose with them, dollars per paycheck. Default 0.
paused_contribution_per_paycheckNoYour own 401(k) contributions you would stop while repaying, dollars per paycheck. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already establish readOnlyHint, idempotentHint, destructiveHint=false and a closed-world profile, so the safety burden is largely carried. The description adds useful scoping context (it is a projection model covering limits, growth gap, and separation-from-service tax), but says nothing about what happens when inputs are invalid or exceed plan limits (loan_amount up to 100,000,000 is accepted by the schema) — that is exactly the behavioral detail an agent needs and the annotations cannot supply.

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

Conciseness3/5

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

Purpose is front-loaded in the first clause, which is good, but the rest is a single run-on sentence stringing together nine distinct outputs with comma splices, making it hard to parse at a glance. Given there is no output schema, most of that content earns its place; the problem is structure rather than length.

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 no output schema and 12 parameters, the description carries the full burden of telling the agent what comes back, and it does so thoroughly — payments, totals, tax later, growth gap at payoff and at 65, legal/plan limits, and the leave-job liability. Only the edge-case behavior (invalid or over-limit inputs) is left unaddressed.

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%, with every one of the 12 parameters documented including defaults, ranges and enum values, so the schema does the heavy lifting. The description adds no parameter-level meaning beyond indirectly hinting that leave_job_after_months drives the separation scenario. Baseline 3 is appropriate.

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?

States a specific verb and resource ('Runs the 401k.loans true-cost calculator') and then enumerates exactly what it returns: per-paycheck payment, total repaid, tax on interest, growth gap, plan limits, and leave-job exposure. That is far more specific than a tautology. It does not, however, distinguish itself from the siblings compare_401k_loan_alternatives and calculate_401k_early_withdrawal, so an agent has no stated basis for choosing among them.

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 through scenario language ('if you might leave the job, the balance owed then'), which signals the conditions the tool covers but never states when to call it instead of compare_401k_loan_alternatives. There is no explicit when-not guidance, no prerequisites, and no mention of whether the inputs must come from the user versus defaults.

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