add_scenario_event
WRITE: add and SAVE a business event/change to an existing NON-Base scenario. Supports the same event types as the UI (hire_people, change_price, change_growth, change_churn, increase_marketing, change_costs…
scenarioId: string, type: string, date: string?, fromMonth: number?, params: object?, label: string?
analyze_businessread-only
Analyze the currently active WhenToProfit project + scenario using the existing forecast results. Returns the revenue trajectory, gross margin, operating margin, profitability timing, cash/runway situation, and a few…
apply_goal_path
WRITE: apply a goal path (candidate changes from find_path_to_goal) to an explicit NON-Base scenario. Each change is validated and applied through the same event-mutation flow the UI uses, then results are…
scenarioId: string, changes: array, goalLabel: string?
calculate_valuationread-only
Estimate the current active project's value using WhenToProfit's simplified approach. Tech/SaaS uses a revenue/ARR multiple (default 4x); Retail/F&B uses an operating-profit multiple (default 3x). Optionally override…
method: string?, multiple: number?
compare_scenariosread-only
Compare WhenToProfit scenarios for the current project by running the existing financial engine for each. Pass an optional array of scenario ids; if omitted, all scenarios are compared. Returns per-scenario total…
scenarioIds: array?
compare_simulationread-only
Run several hypothetical WhenToProfit simulations side by side using the existing financial engine, and return key decision metrics for each plus the current active scenario as a baseline. Each simulation is passed…
simulations: array
create_scenario
WRITE: create and SAVE a new scenario for the active WhenToProfit project. The new scenario is empty, becomes the active scenario, and the project is persisted through the normal store. Base Case is never modified.…
name: string, description: string?
explain_metricread-only
Explain one WhenToProfit metric to a non-finance user. Provide the metric name (e.g. "operational break-even", "runway", "gross margin", "operating margin", "cash-flow positive", "revenue", "operating profit", "ARR"…
metric: string
find_path_to_goalread-only
Search for a feasible set of deterministic changes that could achieve a financial goal in the current WhenToProfit project. Uses the SAME grid-search solver as the Reach a Goal UI. Goal types: 'target_arr'…
goal: string, targetValue: number, targetMonth: number?, cashNeverNegative: boolean?
get_active_scenarioread-only
Get the currently selected WhenToProfit scenario: its id, name, whether it is the Base Case, and every change/event it contains (type, targeted field, value or financing amount, forecast month, calendar month, and…
get_current_projectread-only
Get a structured snapshot of the currently active WhenToProfit project: the project name, business type, forecast start date, the active scenario, all available scenarios with their decision/event counts, the…
get_financial_resultsread-only
Get the complete current forecast results for the active WhenToProfit scenario: a month-by-month table (revenue, variable costs, gross profit, fixed operating costs, operating profit, financing received, cash balance…
get_project_assumptionsread-only
Get the currently active WhenToProfit project's assumptions grouped by category (revenue drivers, variable costs, fixed operating costs, startup/initial investment). Returns both the raw business-level driver values…
inspect_model_healthread-only
Check the current WhenToProfit project + active scenario for obvious data integrity problems the model can detect: zero/negative starting cash, invalid (NaN/negative) assumptions, out-of-range percentages, missing…
move_scenario_event
WRITE: move an existing event/change in a NON-Base scenario to a different calendar month. Provide scenarioId, eventId (change_<index>), and newDate (YYYY-MM) within the forecast. Base Case is immutable. Persists…
scenarioId: string, eventId, newDate: string
remove_scenario_event
WRITE: remove an existing event/change from a NON-Base scenario. Provide scenarioId and eventId ("change_<index>"). Base Case is immutable. Persists through the normal store, recalculates results, and returns the…
scenarioId: string, eventId
rename_scenario
WRITE: rename an existing NON-Base scenario in the active project. Provide scenarioId and a non-empty name. Base Case cannot be renamed. Persists through the normal store.
scenarioId: string, name: string
set_active_scenario
Switch the UI to a different scenario in the active project. Provide scenarioId. Validates that the scenario belongs to the project, then uses the exact same handler as the UI so scorecards/charts update and stay in…
scenarioId: string
simulate_scenarioread-only
Test hypothetical WhenToProfit changes WITHOUT saving them. Provide either raw scenario changes or business events (type + date/fromMonth + params). Runs the existing financial engine on the current project's base…
name: string?, changes: array?, events: array?
update_scenario_event
WRITE: modify an existing event/change in a NON-Base scenario. Provide scenarioId and the event id ("change_<index>"). Update the event type, date/fromMonth, params, or label. Base Case is immutable. Persists through…
scenarioId: string, eventId, type: string, date: string?, fromMonth: number?, params: object?, label: string?