npv-calculator
Compute Net Present Value (NPV) and Internal Rate of Return (IRR) for a series of cashflows discounted at a given rate. Returns NPV, an Accept/Reject decision, IRR, and a per-period present-value breakdown.
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": {
"initial_investment": "<initial_investment>",
"discount_rate_percent": "<discount_rate_percent>",
"cashflows": "<cashflows>"
},
"name": "npv-calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cashflows | Yes | Expected cashflows for periods 1, 2, …, N. Index 0 is period 1. Negative values are allowed (mid-life capex). Must contain at least one entry. | |
| initial_investment | Yes | Period-0 outlay as a positive number (e.g. 10000 for a $10,000 upfront cost). Subtracted from the discounted-cashflow sum. | |
| discount_rate_percent | Yes | Per-period discount rate as a percentage (e.g. 10 for 10%). Must be greater than −100. Negative rates are allowed but unusual. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| npv | Yes | Net Present Value. Positive → accept; negative → reject; zero → indifferent. | |
| periods | Yes | Per-period breakdown. | |
| decision | Yes | Plain-language verdict. Accept when NPV > 0, Reject when NPV < 0, Break-even when |NPV| < 0.01. | |
| irr_percent | Yes | Internal Rate of Return as a percentage. The discount rate that makes NPV = 0. Null when no IRR exists in [-99%, +10000%] (e.g. all cashflows are negative). | |
| total_inflows | Yes | Sum of all cashflows in periods 1..N (undiscounted). | |
| total_pv_inflows | Yes | Sum of all present values in periods 1..N. | |
| initial_investment | Yes | Echoed back. | |
| discount_rate_percent | Yes | Echoed back. |