13-Week Cash Flow Forecast
cash_forecastForecast weekly cash in, cash out and closing balance for 13 weeks with P10 / P50 / P90 ranges, timing receipts by how each customer actually pays. Inputs: ar_open (customer_ref, amount, due_date), ar_history (customer_ref, due_date, paid_date, amount), ap_open (supplier_ref, amount, due_date), payroll, recurring, statutory (gst / tds / pf / esi / advance_tax), fixed_outflows (e.g. loan repayments as fixed amounts), opening_balance, minimum_cash; optional payment_behaviour_snapshot, previous_forecast + actuals, scenarios, explain_week. Returns decision cards, weekly ranges, the probability of falling below minimum_cash and the earliest risky week, drivers of a week, what-if results, accuracy (WAPE, MAPE, bias, Trigg tracking signal) and an updated snapshot. ar_history alone returns days-to-pay per customer. Uses Kaplan-Meier days-to-pay and Monte Carlo. Not for interest, borrowing or investment advice, bank feeds, or accounting entries. Larger ledgers: cash_forecast_get_engine.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "cash_forecast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| as_of | No | Forecast start date (default today); weeks run 7 days from it. | |
| weeks | No | ||
| actuals | No | Actual cash by date or week: date, cash_in, cash_out, closing (or signed amount). | |
| ap_open | No | Open payables: supplier_ref, bill_ref, amount, due_date. | |
| ar_open | No | Open receivables: customer_ref, invoice_ref, amount, due_date (or invoice_date + terms), optional segment. ERP / Tally / Zoho ageing headers are understood. | |
| n_paths | No | ||
| payroll | No | date + amount, or schedule (monthly / weekly / fortnightly) + day + amount. | |
| currency | No | INR | |
| new_sales | No | Expected new invoices: date (or week), amount, optional customer_ref / segment, terms; timed by behaviour like open invoices. | |
| recurring | No | name, amount, schedule (weekly / fortnightly / monthly / quarterly / yearly), day or start date, direction (out default, or in). | |
| scenarios | No | What-ifs: {type: customer_delay, customer, weeks|days}; {type: supplier_delay, supplier, weeks}; {type: inflow|outflow, amount, week|date, label}; {type: customer_no_pay|customer_on_time, customer}; {type: collections_faster|all_customers_delay, days}. | |
| statutory | No | type (gst, tds, pf, esi, pt, advance_tax, vat, payroll_tax, sales_tax) + amount; dates templated (GST 20th, TDS 7th, PF / ESI 15th, advance tax 15 Jun / Sep / Dec / Mar), or day to override. | |
| ap_history | No | Paid bills: supplier_ref, due_date, paid_date, amount (the company's own days-to-pay; used with 10+ paid bills). | |
| ar_history | No | Payment history: customer_ref, invoice_ref, due_date, paid_date, amount (paid_amount for part payments), optional segment. Include old invoices still open (no paid_date): they count as censored. | |
| date_order | No | ||
| max_listed | No | ||
| explain_week | No | ||
| minimum_cash | No | Cushion to test breach risk against. | |
| fixed_inflows | No | date (or week) + amount + label. | |
| fixed_outflows | No | date (or week) + amount + label, e.g. loan repayments as fixed amounts. | |
| currency_symbol | No | ||
| opening_balance | No | Cash today. | |
| payables_policy | No | history_or_due | |
| breach_threshold | No | ||
| min_history_days | No | ||
| previous_forecast | No | An earlier run's output (or its weeks list) for accuracy_report. | |
| default_terms_days | No | ||
| shrinkage_strength | No | ||
| payment_behaviour_snapshot | No | payment_behaviour_snapshot from an earlier run. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| weeks | No | ||
| alerts | No | ||
| status | Yes | 1 = forecast / report produced, 0 = refused (see decisions) | |
| message | No | ||
| accuracy | No | ||
| metadata | Yes | ||
| payments | No | ||
| customers | No | ||
| decisions | Yes | Plain-language cards, priority order. Relay these first. | |
| scenarios | No | ||
| assumptions | No | ||
| breach_risk | No | ||
| explain_week | No | ||
| payment_behaviour | No | ||
| data_quality_report | No | ||
| payment_behaviour_snapshot | No |