Skip to main content
Glama

curatedapi

Net present value (NPV) calculator

calc_finance_npv
Read-only

Net present value of a series of periodic cash flows at a discount rate.

Discounts each cash flow to today and adds them up: NPV = Σ CFₜ / (1 + r)ᵗ. By default the first cash flow happens now (t = 0) and is not discounted, the usual finance-textbook convention. Choose first_cash_flow_at = t1 to match spreadsheet NPV() functions, which discount the first value by one period.

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": {
      "discount_rate_percent": "<discount_rate_percent>",
      "cash_flows": "<cash_flows>"
    },
    "name": "calc_finance_npv"
  }
}

Input Schema

NameRequiredDescriptionDefault
optionsNoPrecision and rounding of the results (default: rounding=half_even, decimals=2).
cash_flowsYesCash flows in time order, one per period. Money paid out is negative, money received is positive. 1 to 600 items. Each item: >= -1000000000000000 and <= 1000000000000000.
first_cash_flow_atNoWhen the first cash flow happens. Options: t0: now, not discounted (finance convention); t1: at the end of the first period (spreadsheet NPV convention)t0
discount_rate_percentYesDiscount rate per period, in percent. Allowed: > -100 and <= 1000. Unit: percent.

Output Schema

NameRequiredDescriptionDefault
inputsYesThe inputs as understood.
resultYes
formulaNo
receiptNoOnly with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify.
warningsYes
exactnessYesFor each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0).
precisionNoThe precision and rounding that were applied.
calculatorYesThe calculator and version that ran.
referencesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare a pure read-only, closed-world, non-destructive calculation, so the main behavioral burden is covered. The description usefully adds the discounting convention and default timing, but says nothing about precision/rounding effects or output shape beyond the formula. The addition is genuine but modest.

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?

Two compact paragraphs: the first defines the operation and formula, the second front-loads the timing convention and its alternative. No redundant restatement of the tool name or padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

All four parameters are documented in the schema, an output schema exists so return values need not be explained, and the one ambiguous convention is resolved in prose. An agent has everything needed to call this correctly.

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 units, ranges, and enum meanings already documented per parameter, so the baseline is 3. The description reinforces first_cash_flow_at with a concrete contrast, but adds no new syntax or constraint details beyond what the schema states.

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 – net present value of a series of periodic cash flows at a discount rate – and the formula pins down exactly what is computed. This clearly separates it from siblings such as calc_finance_irr or calc_finance_compound_interest.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear decision rule for the key choice: default t0 follows finance-textbook convention, while first_cash_flow_at = t1 matches spreadsheet NPV(). That is explicit conditional guidance, though it does not discuss when to prefer this tool over an IRR or ROI sibling.

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