get_yoy_monthly
Month-by-month year-over-year comparison for a single metric. SINGLE-CALL ANSWER for 'how is revenue this year vs last year by month?' / 'show me 2026 vs 2025 monthly trends'. Returns { metric, currentYear, compareYear, rows, totals, charts, presentation, seeAlso }. rows is one entry per month with current/compare/change. charts[0] is a ready-to-render grouped-bar spec (seriesField='year') — drop straight into a chart library. totals gives the year-to-date sum + YoY %. Reads pre-aggregated calendar-month snapshots so it's clean and quick. DEFAULT TO RENDERING THE CHART for any 'X this year vs last year by month' question.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store | No | Filter by sub-store key (e.g. 'acme-store-us'). Omit to sum across all stores in the workspace. | |
| metric | Yes | Metric key (e.g. 'revenue', 'orders', 'aov', 'cvr', 'sessions', 'tickets_total'). Must be one that has been captured as a calendar-month snapshot. | |
| source | No | Filter by source ('shopify', 'tw', 'ga4', 'google-ads', 'search-console', 'gorgias', 'shipstation'). Omit to sum across sources — usually only useful for metrics that appear in multiple sources (e.g. 'revenue' in both shopify and tw). | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| compareYear | No | Year to compare against. Defaults to currentYear - 1. | |
| currentYear | No | Year to use as the current side of the comparison. Defaults to the current calendar year (UTC). |