Skip to main content
Glama

MaliMoney Calculators

Optimal Spend

optimal_spend
Read-onlyIdempotent

Solve for the MOST the user can sustainably spend per year in retirement while keeping a target probability (default 85%) that the money lasts. Use when the user asks 'how much can I spend', 'what's a safe withdrawal', 'how much can I afford in retirement', or 'what's the most I can take out'. Unlike a projection you feed a spend into, this SOLVES for the spend number via simulation over realistic historical market paths. Quote the annual and monthly figure and the target success rate; present it as an educational estimate, not advice.

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": {
      "currentAge": "<currentAge>",
      "currentBalance": "<currentBalance>",
      "targetRetireAge": "<targetRetireAge>"
    },
    "name": "optimal_spend"
  }
}

Input Schema

NameRequiredDescriptionDefault
currentAgeYes
ssStartAgeNo
inflationPctNo
annualSavingsNo
ssMonthlyAt67No
currentBalanceYesCurrent retirement portfolio balance.
targetRetireAgeYes
targetSuccessRateNoDesired probability the plan lasts, 0.5–0.99. Default 0.85.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, closed-world, non-destructive behavior, so the safety profile is covered. The description adds real value beyond that: it discloses the methodology (simulation over realistic historical market paths), the default target probability, and an output-handling obligation (quote annual + monthly figure and success rate, frame as educational estimate not advice). It does not mention runtime/compute cost or result variability across simulation runs, which would round out the behavioral picture.

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?

Front-loaded with the core definition, then trigger phrases, then the differentiation from projections, then output instructions. The quoted user-phrasing list is long but serves routing value; no sentence is filler, though the entry is on the verbose side of what is strictly needed.

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?

With 8 parameters (5 optional and undocumented), no output schema, and a non-trivial simulation model, the definition should say more about how savings, Social Security inputs, and inflation feed the solve. It partially compensates by prescribing what to report back (annual and monthly figures, success rate), which reduces dependence on an output schema, but the optional-input story remains incomplete.

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 only 25%, so the description should carry more weight. It does clarify the two most consequential semantics — targetSuccessRate defaults to 85% and represents the probability the money lasts — but says nothing about currentAge, targetRetireAge, ssStartAge, ssMonthlyAt67, annualSavings, or inflationPct, leaving six parameters to the bare schema names.

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?

States a specific verb ('SOLVES for the spend number') and specific resource (sustainable annual retirement spend at a target success probability). It also explicitly contrasts with the inverse tool class ('Unlike a projection you feed a spend into'), so an agent can distinguish it from monte_carlo_retirement or retirement_readiness without inspecting schemas.

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?

Provides concrete trigger phrasings ('how much can I spend', 'what's a safe withdrawal', 'what's the most I can take out') and the opposing condition (a projection where the user supplies the spend). Usage guidance is explicit rather than inferred.

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