Generate profit and loss
generate_profit_and_lossGenerates a standard profit and loss statement for one chart over an optional inclusive date range: revenue and expense accounts with totals and net income. chart_id is required only when the workspace has more than one active chart; omitted bounds are open-ended; include_zero_accounts defaults to true. Amounts are summed as posted. completeness says what the books lack: a chart_exception (nothing posted since the data changed), open requests, notices. Read-only and not metered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date_to | No | Optional inclusive end date in YYYY-MM-DD format. Omitted is open-ended. | |
| chart_id | No | Optional chart id. Required when the workspace has more than one active chart; may be omitted when exactly one exists. | |
| date_from | No | Optional inclusive start date in YYYY-MM-DD format. Omitted is open-ended. | |
| workspace_tag | Yes | Active workspace id (the workspace_tag create_workspace and list_workspaces return). | |
| include_zero_accounts | No | Include chart accounts with no posting activity. Defaults to true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engine | Yes | Stamped engine build/version identity for the tool result. | |
| status | Yes | profit_and_loss_generated on success. | |
| date_to | Yes | Inclusive end; null is open-ended. | |
| revenue | Yes | Revenue rows. | |
| chart_id | Yes | The one chart this report covers. | |
| expenses | Yes | Expense rows. | |
| date_from | Yes | Inclusive start; null is open-ended. | |
| row_count | Yes | Number of returned rows. | |
| chart_name | Yes | The chart's name. | |
| net_income | Yes | total_revenue minus total_expenses. | |
| completeness | Yes | What these books lack. complete is true only with no chart_exception and no open request. A chart with an exception has posted nothing since the data changed, so the numbers predate it; open requests (list_review_items, level request) leave the books short or provisional; notices change nothing. | |
| total_revenue | Yes | Sum of detail revenue amounts. | |
| workspace_tag | Yes | Workspace scoped by the tool call. | |
| total_expenses | Yes | Sum of detail expense amounts. |