get_pnl
Compute Profit & Loss (P&L / net income / margin) by combining the Income tab with expense tabs. Examples: 'am I profitable this year', 'P&L for Q1', 'net income last quarter', 'what's my margin', 'P&L this year vs last' (YoY). Supports period comparison — YoY, MoM, QoQ, same-month-prev-year. Margin renders as multiplier in loss territory ('expenses 5.4× revenue') so the user gets a readable signal instead of '-436.9% margin'. Returns: { message, data: { revenue, expenses, netIncome, margin, comparison?, sampleMeta? } }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Natural language P&L question (e.g., 'P&L for Q1 2025', 'am I profitable') | |
| dateRange | No | Time period filter. Use exactly one variant — pick the shape that matches the user's phrasing. | |
| clientEmail | No | Client account email. Accountants may use this only for an accepted ExpenseBot client. |