Skip to main content
Glama

CAGR and inflation adjustment

cagr_inflation
Read-onlyIdempotent

Calculate Compound Annual Growth Rate (CAGR), real inflation-adjusted purchasing power growth (Fisher equation), and exact investment doubling time (Rule of 72 exact logarithmic solution).

Behavior: Deterministic, idempotent calculation with zero external side effects. Computes Nominal CAGR = (finalValue / initialValue)^(1 / periodsYears) - 1. Computes Real CAGR using the exact Fisher relation: (1 + Nominal) / (1 + Inflation) - 1. Computes exact doubling horizon = ln(2) / ln(1 + Nominal). Returns nominal CAGR %, real CAGR %, total nominal gain, total real purchasing power gain, and doubling years.

Usage Guidelines: Use for evaluating historical investment portfolio track records, business revenue growth metrics, and inflation drag analysis. Do not use for forward-looking recurring monthly investment projections; use compound_wealth or sip_investment instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoHISTORICAL_CAGR: growth from initialValue to finalValue. PROJECTION: grow initialValue at expected_annual_return_rate.
as_of_dateYesCivil date YYYY-MM-DD. Selects the rule pack in force on that date. Required: the engine will not assume a date.
finalValueYesEnding value (HISTORICAL_CAGR), as a string with exactly 2 decimal places.
initialValueYesStarting value, as a string with exactly 2 decimal places.
periodsYearsYesPeriod in years, from 0.0833 (1 month) to 50.
inflationRatePercentNoAnnualized inflation rate percentage over the period (e.g. 2.5 for 2.5%).
expected_annual_return_rateNoExpected annual return in percent, as a decimal string. Required for PROJECTION mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / as_of_date
      Added value: +{
      +  "description": "Civil date YYYY-MM-DD. Selects the rule pack in force on that date. Required: the engine will not assume a date.",
      +  "example": "2026-09-26",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "initialValue",
      -  "finalValue",
      -  "periodsYears",
      -  "mode"
      -]New value: +[
      +  "initialValue",
      +  "finalValue",
      +  "periodsYears",
      +  "as_of_date"
      +]
  2. Changed15 schema fields changed
    • addedInput schema / properties / expected_annual_return_rate
      Added value: +{
      +  "description": "Expected annual return in percent, as a decimal string. Required for PROJECTION mode.",
      +  "example": "12.00",
      +  "pattern": "^\\d+(\\.\\d+)?$",
      +  "type": "string"
      +}
    • changedInput schema / properties / finalValue / description
      Previous value: -"Ending portfolio, asset, or revenue valuation in currency units. Must be positive."New value: +"Ending value (HISTORICAL_CAGR), as a string with exactly 2 decimal places."
    • addedInput schema / properties / finalValue / example
      Added value: +"250000.00"
    • addedInput schema / properties / finalValue / pattern
      Added value: +"^\\d+\\.\\d{2}$"
    • changedInput schema / properties / finalValue / type
      Previous value: -"number"New value: +"string"
    • changedInput schema / properties / initialValue / description
      Previous value: -"Beginning portfolio, asset, or revenue valuation in currency units. Must be positive."New value: +"Starting value, as a string with exactly 2 decimal places."
    • addedInput schema / properties / initialValue / example
      Added value: +"100000.00"
    • addedInput schema / properties / initialValue / pattern
      Added value: +"^\\d+\\.\\d{2}$"
    • changedInput schema / properties / initialValue / type
      Previous value: -"number"New value: +"string"
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "HISTORICAL_CAGR: growth from initialValue to finalValue. PROJECTION: grow initialValue at expected_annual_return_rate.",
      +  "enum": [
      +    "HISTORICAL_CAGR",
      +    "PROJECTION"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / periodsYears / description
      Previous value: -"Total elapsed duration in years (can be fractional, e.g. 2.5 or 5). Must be greater than 0."New value: +"Period in years, from 0.0833 (1 month) to 50."
    • addedInput schema / properties / periodsYears / example
      Added value: +10
    • addedInput schema / properties / periodsYears / maximum
      Added value: +50
    • addedInput schema / properties / periodsYears / minimum
      Added value: +0.0833
    • changedInput schema / required
      Previous value: -[
      -  "initialValue",
      -  "finalValue",
      -  "periodsYears"
      -]New value: +[
      +  "initialValue",
      +  "finalValue",
      +  "periodsYears",
      +  "mode"
      +]
  3. Changed3 schema fields changed
    • removedInput schema / properties / finalValue / default
      Removed value: -100000
    • removedInput schema / properties / initialValue / default
      Removed value: -50000
    • removedInput schema / properties / periodsYears / default
      Removed value: -5
  4. Changed4 schema fields changed
    • changedInput schema / properties / finalValue / description
      Previous value: -"Ending portfolio / asset valuation ($)"New value: +"Ending portfolio, asset, or revenue valuation in currency units. Must be positive."
    • changedInput schema / properties / inflationRatePercent / description
      Previous value: -"Annualized expected inflation rate %"New value: +"Annualized inflation rate percentage over the period (e.g. 2.5 for 2.5%)."
    • changedInput schema / properties / initialValue / description
      Previous value: -"Beginning portfolio / asset valuation ($)"New value: +"Beginning portfolio, asset, or revenue valuation in currency units. Must be positive."
    • changedInput schema / properties / periodsYears / description
      Previous value: -"Duration in years"New value: +"Total elapsed duration in years (can be fractional, e.g. 2.5 or 5). Must be greater than 0."
  5. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint. The description reinforces these with 'deterministic, idempotent calculation with zero external side effects' and adds the exact formulas and output values. While it doesn't disclose anything beyond annotations, it does add context on computation and returns, which is valuable.

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?

The description is well-structured with clear sections for purpose, behavior, and usage guidelines. It front-loads the primary function and keeps each sentence informative without redundancy. The length is justified by the tool's complexity.

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?

The description explains the return values (nominal CAGR %, real CAGR %, total gains, doubling years) and provides usage boundaries. However, it does not explicitly explain the 'mode' parameter (HISTORICAL_CAGR vs PROJECTION) or when to use PROJECTION mode. Since the schema covers the parameter, this is a minor gap, but for a tool with multiple modes, an explicit mention would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds meaning by showing how parameters are used in formulas (e.g., finalValue/initialValue, periodsYears, inflationRatePercent), which clarifies their role beyond the schema's field-level descriptions. This is a modest enhancement over the baseline of 3.

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 explicitly states what the tool does: calculates CAGR, real inflation-adjusted growth, and doubling time, with a clear verb and resource. It also differentiates from siblings by naming compound_wealth and sip_investment as alternatives for different use cases.

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 provides explicit when-to-use scenarios (historical portfolio track records, business revenue growth, inflation drag analysis) and when-not-to-use (forward-looking recurring monthly projections), naming the exact alternative tools. This fully satisfies the requirement for usage guidance.

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