Cashflow payback period

cashflow-payback-period · version 1.0.0 · Financial calculations · free, no key needed

Payback period of periodic cash flows with linear interpolation, optional discounting and the cumulative path.

Use when you need to: payback period of a project · how long to recover the initial investment · discounted payback period.

Decide before calling

Read the versioned contract and the supported scope below. Reuse cashflow-payback-period@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use cashflow-payback-period@1.0.0 for payback period of a project. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "cash_flows": [
    "-2000",
    "500",
    "500",
    "5000"
  ]
}

Response:

{
  "result": {
    "recovered": true,
    "payback_period": "2.2000000000",
    "payback_period_whole": 3,
    "cumulative": [
      "-2000.00",
      "-1500.00",
      "-1000.00",
      "4000.00"
    ],
    "discounted": false
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "cashflow-payback-period",
  "version": "1.0.0",
  "input": {
    "cash_flows": [
      "-2000",
      "500",
      "500",
      "5000"
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/cashflow-payback-period/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"cash_flows":["-2000","500","500","5000"]}'

The machine-readable contract is at /v1/tools/cashflow-payback-period/versions/1.0.0.

CLI

node cli.mjs run cashflow-payback-period 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.