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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo
traceNo
statusNo
as_of_dateNo
disclaimerNo
final_valueNo
tenure_yearsNo
initial_valueNo
rule_ids_usedNo
rule_of_72_yearsNo
real_cagr_percentNo
yearly_trajectoryNo
total_absolute_gainNo
exact_doubling_yearsNo
nominal_cagr_percentNo
purchasing_power_lossNo
inflation_rate_appliedNo
real_purchasing_power_valueNo
nominal_total_return_percentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "as_of_date": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "disclaimer": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "exact_doubling_years": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "final_value": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "inflation_rate_applied": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "initial_value": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "mode": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "nominal_cagr_percent": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "nominal_total_return_percent": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "purchasing_power_loss": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "real_cagr_percent": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "real_purchasing_power_value": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "rule_ids_used": {
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "rule_of_72_years": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "status": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "tenure_years": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "total_absolute_gain": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "trace": {
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "yearly_trajectory": {
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. 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"
      +]
  3. 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"
      +]
  4. 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
  5. 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."
  6. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false and destructiveHint=false, so the safety profile is covered; the description's 'deterministic, idempotent, zero external side effects' sentence is partly redundant with that. It does add genuine value by disclosing the exact computational relations (Fisher equation, ln(2)/ln(1+Nominal)) and the returned metrics, which the annotations cannot convey.

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 tool's purpose, then behavior, then usage routing in distinct labeled blocks. The formula clauses are dense but arguably earn their place for a math utility; the sentence count is modest and there is 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?

An output schema exists, so explaining return values is technically unnecessary, yet the description still enumerates them (nominal CAGR %, real CAGR %, gains, doubling years) for clarity. Combined with annotations covering safety and idempotency, an agent has enough to call the tool correctly, though PROJECTION mode usage is left entirely to the 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 all seven parameters, including the mode enum and the PROJECTION-only expected_annual_return_rate, are already documented in the schema. The description implies how initialValue, finalValue, periodsYears and inflation combine mathematically, but never mentions 'mode' or the projection path, so it does not add parameter meaning beyond the schema.

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 and resource (Compute CAGR, real inflation-adjusted growth, doubling time) and names the exact outputs produced. The usage section explicitly names the sibling tools compound_wealth and sip_investment it is not, so an agent can separate it from look-alike growth calculators.

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 explicit 'use for' contexts (historical portfolio track records, revenue growth, inflation drag) and an explicit 'do not use for' with the alternative tools to pick instead (compound_wealth, sip_investment). 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