Net present value (NPV) calculator
calc_finance_npvNet 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
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | Precision and rounding of the results (default: rounding=half_even, decimals=2). | |
| cash_flows | Yes | Cash 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_at | No | When 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_percent | Yes | Discount rate per period, in percent. Allowed: > -100 and <= 1000. Unit: percent. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | Yes | The inputs as understood. | |
| result | Yes | ||
| formula | No | ||
| receipt | No | Only 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. | |
| warnings | Yes | ||
| exactness | Yes | For 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). | |
| precision | No | The precision and rounding that were applied. | |
| calculator | Yes | The calculator and version that ran. | |
| references | No |