aggregate_pnl_by_cost_center
P&L metrics per cost center and period across the full history, paginated. revenue is the sum of ALL labels in the tenant's revenue group — sales deductions and penalties booked on revenue-group labels are already netted in; with include_categories=true you see the split per label (category_totals, result effect: revenue +, expense −), and revenue is then the sum of the revenue-group categories. Pages losslessly over cost_center via after_cost_center/next_cursor (with categories each row counts several times against the page budget; the response states the weight). Use available_range to state the overall time range; never claim 'no data' when available_range says otherwise. For yearly/quarterly figures (e.g. 'EBIT per year per cost center') set granularity — the tool then returns the finished yearly figure instead of you adding up monthly values. Hidden cost centers stay included and are marked as hidden on each row. If the user names a cost center (e.g. "Betriebsrat"), call get_cost_center_list FIRST to resolve its number; never guess the number.
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": "aggregate_pnl_by_cost_center"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metrics | No | Which metrics to return (default: all six) | |
| period_to | No | End period YYYY-MM (optional) | |
| granularity | No | Time bucket of the returned figures: 'month' (default), 'quarter', 'year' or 'total'. Set this whenever the answer needs a figure covering more than one month — never add the monthly values up yourself. | |
| period_from | No | Start period YYYY-MM (optional) | |
| cost_centers | No | Optional cost center ID filter | |
| after_cost_center | No | Pagination cursor: pass pagination.next_cursor from the previous call to fetch the next page | |
| include_categories | No | Default false. true = each row also carries category_totals (label name → value, revenue +, expense −), category_label_ids (name → ids of the labels summed into it) and category_totals_sort_order. Fewer cost centers fit on a page. |