mureo_state_platform_metrics_set
Set platform metric rollups in STATE.json to update the dashboard's per-platform KPIs and period toggle without re-querying. Writes totals for the most recent window or per-window rollups.
Instructions
Atomically set a platform's metric ROLLUP in STATE.json's v2 platforms section so the read-only reporting dashboard can render per-platform KPIs (and the YESTERDAY / LAST_30_DAYS period toggle) without re-querying. This writes the PLATFORM-LEVEL rollup — distinct from mureo_state_upsert_campaign, which writes per-campaign metrics. Pass totals + metrics_period for the single most-recent window, and/or periods ({"YESTERDAY": {…}, "LAST_30_DAYS": {…}}) for the per-window rollups the toggle reads. periods is merged per window key (a YESTERDAY write keeps a prior LAST_30_DAYS bucket); omitted fields preserve their existing value. Campaigns and every other platform are preserved. account_id is required and always written onto the entry. Returns the updated state document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | Platform key: a built-in (``google_ads`` / ``meta_ads`` / ``search_console`` / ``ga4``) or a plugin bridge ``plugin:<dist>``. | |
| account_id | Yes | The platform account id (Google customer_id / Meta act_*). Always written onto the platform entry. | |
| totals | No | Single-rollup totals for the most recent window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, period, fetched_at). Omit to preserve the existing value. | |
| metrics_period | No | The window ``totals`` covers (e.g. ``LAST_30_DAYS``). Omit to preserve the existing value. | |
| periods | No | Per-window rollups keyed by period token (``YESTERDAY`` / ``LAST_30_DAYS`` / …); each value is a totals-shaped object. Merged per key into the existing map. Omit to preserve the existing map. | |
| path | No | Optional path to the file. Defaults to STRATEGY.md / STATE.json in the MCP server's current working directory. Paths outside cwd are refused. |