Npv
workflow.run_npvNet present value of a list of cash flows at a discount rate per period. The first flow is at time 0 and is NOT discounted (the usual textbook NPV; a spreadsheet NPV() function discounts the first value one period, so its result is this one divided by 1 + rate). Money received is positive, money paid is negative. ratePerPeriod must match the spacing of the flows (a monthly rate for monthly flows). To find the rate that makes NPV zero use workflow.run_irr. Edge cases: ratePerPeriod strictly above -1 and at most 1e6, as a fraction per period (0.05 is 5%), not per year; 1 to 1000 cash flows, the first at time 0, all finite; money received is positive and money paid is negative. Not covered: flows at irregular dates (use equal periods), a rate that changes, taxes, inflation, and the choice of discount rate; a positive NPV is arithmetic, not a decision. Use when user asks "is this project worth doing at a 10% cost of capital?" or "what is the NPV of these cash flows?". Returns: npv, discountedFlows, pvOfInflows, pvOfOutflows, undiscountedSum, periods.
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": {
"ratePerPeriod": "<ratePerPeriod>",
"cashFlows": "<cashFlows>"
},
"name": "workflow.run_npv"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cashFlows | Yes | Cash flow at time 0, 1, 2, ... (e.g. [-1000, 500, 500, 500]); use 0 for an empty period | |
| ratePerPeriod | Yes | Discount rate per period as a fraction (0.1 = 10% per period), above -100%, at most 1e6 |