get_xero_profit_and_loss
get_xero_profit_and_lossProfit and Loss report from Xero for the current organisation, for a date range. Read-only. columns gives the period label(s) for the numbers in each row; rows are flattened from Xero's nested section layout (section names the enclosing group, e.g. "Income" or "Operating Expenses"; rowType "SummaryRow" marks a subtotal/total, not a line item - do not double-count a SummaryRow alongside the rows it totals). currency comes from this organisation's own Xero settings, never assumed from anything about the Invio account asking the question - state it whenever relaying a figure from this report. fromDate and toDate must be supplied TOGETHER or OMITTED TOGETHER - never just one; supplying only one is rejected rather than silently widened (see each argument's own description for why). This organisation's financial year is NOT necessarily the calendar year (added 11 September 2026 - see lib/xero/financial-year.ts). financialYear in the result names the organisation's real financial year end and its exact current/previous dates, or says the year end is unknown. Never answer "this financial year", "last financial year", or "year to date" from the calendar year or the organisation's country - use financialYear's dates as fromDate/toDate, and state the period you actually used when relaying a figure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toDate | No | End date, YYYY-MM-DD. Must be supplied together with fromDate, or omitted together with it - never alone, for the identical reason. Omit both to get the CURRENT calendar month. | |
| fromDate | No | Start date, YYYY-MM-DD. Must be supplied together with toDate, or omitted together with it - never alone (Xero would default toDate to the end of the CURRENT month, not the month fromDate is in). Omit both to get the CURRENT calendar month. | |
| organisation | No | The Xero organisation to use, by its display name. Only needed if this connection reaches more than one organisation - omit it when there is only one. |