Skip to main content
Glama

Net present value

calc_npv
Read-onlyIdempotent

NPV of periodic cash flows (t = 0, 1, 2, ...; the t = 0 flow is not discounted) at a per-period discount rate given as a decimal. Deterministic: the same inputs always give the same result, with formula ID calc.npv@1, every step, and any warnings.

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": {
      "cash_flows": "<cash_flows>",
      "rate": "<rate>"
    },
    "name": "calc_npv"
  }
}

Input Schema

NameRequiredDescriptionDefault
rateYesDiscount rate per period as a decimal, e.g. 0.08 for 8%. Match the cash-flow period: for monthly flows pass the monthly rate (e.g. 0.06 ÷ 12 = 0.005). Must be greater than -1.
cash_flowsYesPeriodic cash flows at t = 0, 1, 2, …; negative for outflows (e.g. purchase price at t = 0). At most 10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / rate / description
      Previous value: -"Discount rate per period as a decimal, e.g. 0.08 for 8%. Match the cash-flow period: for monthly flows pass the monthly rate (e.g. 0.06 ÷ 12 = 0.005)."New value: +"Discount rate per period as a decimal, e.g. 0.08 for 8%. Match the cash-flow period: for monthly flows pass the monthly rate (e.g. 0.06 ÷ 12 = 0.005). Must be greater than -1."
    • removedInput schema / properties / rate / exclusiveMinimum
      Removed value: --1
    • addedInput schema / properties / rate / minimum
      Added value: +-1
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new context beyond that: the tool is deterministic, stamps a formula ID (calc.npv@1), and returns every step plus any warnings — useful signal about output behavior for a tool with 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?

Two dense sentences with the discounting convention front-loaded and no filler. The trailing clause 'with formula ID calc.npv@1, every step, and any warnings' is grammatically loose and slightly obscures what is being described, which keeps it from a 5.

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?

For a two-parameter, read-only calculation with full schema coverage and annotations covering safety, the definition supplies what is missing: timing convention, rate units, and the fact that steps and warnings come back. It could still say more about array length limits or error behavior, but nothing essential is absent.

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 both parameters (rate, cash_flows) are already fully documented, including the 0.08-for-8% example and the t = 0 outflow convention. The description restates rather than extends that, so the baseline of 3 applies.

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?

The description names a specific computation (NPV) over a specific resource (periodic cash flows) and pins down the convention that matters most: t = 0 cash flow is not discounted and the rate is per-period as a decimal. It does not distinguish itself from rate-solving siblings such as calc_irr, so it stops short of a 5.

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: the per-period/decimal framing and the t = 0 convention tell an agent how to call it correctly, but there is no explicit when-to-use statement and no guidance on choosing between this and alternatives like calc_irr or calc_dcf_pro_forma.

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.