get_metric_trend
Time series for a SINGLE named metric across periods, with month-over-month AND year-over-year change already computed (value, change, change_percentage, yoy_change, yoy_change_percentage, compared_period per point). Use this for 'how does X develop over time' questions about one bucket (revenue, other_income, cogs, opex, depreciation, financial, tax), one derived P&L aggregate (gross_margin, ebitda, ebit, ebt, net_income), or one P&L category from tenant_config.pnl_labels. Prefer get_periodic_summaries instead when you need ALL metrics for a period at once (no single-metric filter, but it does have sort_order/include_previous); prefer compute_aggregates instead for account/cost-center/category SUMS with grouping, share, or cumulative — compute_aggregates cannot compute the derived P&L aggregates (ebitda etc.) this tool knows about. Time range: periods (a COUNT of the most recent periods, default 12) or date_from/date_to — not a period list like other tools.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"metric": "<metric>"
},
"name": "get_metric_trend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | Yes | Metric name: one of "revenue", "other_income", "cogs", "opex", "depreciation", "financial", "tax" (buckets) or "gross_margin", "ebitda", "ebit", "ebt", "net_income" (aggregates), or any P&L category name from tenant_config.pnl_labels. | |
| date_to | No | Alternative to `periods`: end of a date range (YYYY-MM-DD or YYYY-MM), independent of date_from. | |
| periods | No | Number of most recent periods to include (default 12). A count, not a period list. | |
| date_from | No | Alternative to `periods`: start of a date range (YYYY-MM-DD or YYYY-MM), independent of date_to. | |
| 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. |