Skip to main content
Glama

mureo_state_platform_metrics_set

Set a platform's metric rollups in STATE.json so the reporting dashboard renders per-platform KPIs without re-querying. Provide totals and per-window periods with period_end to keep age accurate.

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. The window vocabulary is closed — see metrics_period. Every rollup you pass without a usable fetched_at — omitted, null or blank — is stamped with the write time, so the dashboard can state an age instead of "update time unknown"; pass your own only when the figures were pulled at some other time (a historical window). Also pass period_end on every rollup (YYYY-MM-DD): the last calendar date those figures cover, in the ad account's own timezone. It is NOT the same fact as fetched_at, and the server cannot derive it — the account's timezone is not something this process reliably knows, and a coverage date off by one day is worse than none. A rollup written without it is judged stale on its write time alone, which is how a card comes to read "Updated 14 hours ago" over figures from two days earlier. Campaigns and every other platform are preserved. account_id is required and always written onto the entry. If this platform carries a not_collected note (a previous collection failure), clear it in the same pass — call mureo_state_platform_not_collected_set with reason omitted; this call preserves the note rather than guessing that one window's rollup means the platform recovered. Returns the updated state document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoOptional path to the file. Defaults to STRATEGY.md / STATE.json in the MCP server's current working directory. Paths outside cwd are refused.
reasonNoWhy this change is being made: one or two sentences naming the evidence and the expected effect. Stored in the journal and on the action_log entry this call produces, for the operator and the next session.
totalsNoSingle-rollup totals for the most recent window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, period, fetched_at, period_end). Omit to preserve the existing value. ``fetched_at`` (ISO 8601) is stamped with the write time when you leave it out — or send it null/blank; supply a real one only for figures pulled at some other time. ``period_end`` (YYYY-MM-DD) is the last calendar date these figures COVER, which is a different fact from when they were written and is never derived for you — see the tool description.
periodsNoPer-window rollups keyed by period token; each value is a totals-shaped object. The keys are the same closed set as ``metrics_period``, under the same rule: any other key is refused, never rounded onto a neighbouring window. Merged per key into the existing map. Omit to preserve the existing map. Each bucket you pass without a ``fetched_at`` is stamped with the write time; a bucket this call merely preserves is never re-stamped. State each bucket's own ``period_end`` — the windows end on different days and one date copied across them mislabels the rest.
platformYesPlatform key: a built-in (``google_ads`` / ``meta_ads`` / ``tiktok_ads`` / ``search_console`` / ``ga4``), a platform an installed plugin registered (its provider name), or a plugin bridge ``plugin:<dist>:<provider>``. Use the SAME key the account is already stored under — one ad account has exactly one platform key, and a second key for an account another key already holds is REJECTED (the reporting view sums the entries, so it would double-count). A NEW key that is none of the three is REJECTED too: do not invent or abbreviate a platform name.
account_idYesThe platform account id (Google customer_id / Meta act_*). Always written onto the platform entry, and used to detect a second entry for the same account. A placeholder (``unknown``, ``n/a``, …) is refused: if the collection could not resolve an id, use mureo_state_platform_not_collected_set.
metrics_periodNoThe window ``totals`` covers — the only windows mureo reports on. A window outside this list is refused, never rounded onto a neighbour (eight days of figures are not a seven-day answer). If your analysis covers another span, report it in your reply instead of inventing a window token: no view reads one, so the write would report success while the dashboard truthfully keeps showing the last real figures as stale. Omit to preserve the existing value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.21.3
    • changedInput schema / properties / account_id / description
      Previous value: -"The platform account id (Google customer_id / Meta act_*). Always written onto the platform entry, and used to detect a second entry for the same account."New value: +"The platform account id (Google customer_id / Meta act_*). Always written onto the platform entry, and used to detect a second entry for the same account. A placeholder (``unknown``, ``n/a``, …) is refused: if the collection could not resolve an id, use mureo_state_platform_not_collected_set."
    • changedInput schema / properties / periods / description
      Previous value: -"Per-window rollups keyed by period token; each value is a totals-shaped object. The keys are the same closed set as ``metrics_period``, under the same rule: any other key is refused, never rounded onto a neighbouring window. Merged per key into the existing map. Omit to preserve the existing map. Each bucket you pass without a ``fetched_at`` is stamped with the write time; a bucket this call merely preserves is never re-stamped."New value: +"Per-window rollups keyed by period token; each value is a totals-shaped object. The keys are the same closed set as ``metrics_period``, under the same rule: any other key is refused, never rounded onto a neighbouring window. Merged per key into the existing map. Omit to preserve the existing map. Each bucket you pass without a ``fetched_at`` is stamped with the write time; a bucket this call merely preserves is never re-stamped. State each bucket's own ``period_end`` — the windows end on different days and one date copied across them mislabels the rest."
    • changedInput schema / properties / periods / properties / LAST_30_DAYS / description
      Previous value: -"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at)."New value: +"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at, period_end). ``period_end`` is the last calendar date THESE figures cover (YYYY-MM-DD, the ad account's own timezone) — state it per window, never copied from another one."
    • changedInput schema / properties / periods / properties / LAST_7_DAYS / description
      Previous value: -"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at)."New value: +"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at, period_end). ``period_end`` is the last calendar date THESE figures cover (YYYY-MM-DD, the ad account's own timezone) — state it per window, never copied from another one."
    • changedInput schema / properties / periods / properties / YESTERDAY / description
      Previous value: -"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at)."New value: +"Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at, period_end). ``period_end`` is the last calendar date THESE figures cover (YYYY-MM-DD, the ad account's own timezone) — state it per window, never copied from another one."
    • changedInput schema / properties / totals / description
      Previous value: -"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. ``fetched_at`` (ISO 8601) is stamped with the write time when you leave it out — or send it null/blank; supply a real one only for figures pulled at some other time."New value: +"Single-rollup totals for the most recent window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, period, fetched_at, period_end). Omit to preserve the existing value. ``fetched_at`` (ISO 8601) is stamped with the write time when you leave it out — or send it null/blank; supply a real one only for figures pulled at some other time. ``period_end`` (YYYY-MM-DD) is the last calendar date these figures COVER, which is a different fact from when they were written and is never derived for you — see the tool description."
  2. Changed1 schema field changedv0.20.0
    • addedInput schema / properties / reason
      Added value: +{
      +  "description": "Why this change is being made: one or two sentences naming the evidence and the expected effect. Stored in the journal and on the action_log entry this call produces, for the operator and the next session.",
      +  "maxLength": 500,
      +  "type": "string"
      +}
  3. Changed7 schema fields changedv0.13.1
    • changedInput schema / properties / metrics_period / description
      Previous value: -"The window ``totals`` covers (e.g. ``LAST_30_DAYS``). Omit to preserve the existing value."New value: +"The window ``totals`` covers — the only windows mureo reports on. A window outside this list is refused, never rounded onto a neighbour (eight days of figures are not a seven-day answer). If your analysis covers another span, report it in your reply instead of inventing a window token: no view reads one, so the write would report success while the dashboard truthfully keeps showing the last real figures as stale. Omit to preserve the existing value."
    • addedInput schema / properties / metrics_period / enum
      Added value: +[
      +  "YESTERDAY",
      +  "LAST_7_DAYS",
      +  "LAST_30_DAYS"
      +]
    • addedInput schema / properties / periods / additionalProperties
      Added value: +false
    • changedInput schema / properties / periods / description
      Previous value: -"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."New value: +"Per-window rollups keyed by period token; each value is a totals-shaped object. The keys are the same closed set as ``metrics_period``, under the same rule: any other key is refused, never rounded onto a neighbouring window. Merged per key into the existing map. Omit to preserve the existing map. Each bucket you pass without a ``fetched_at`` is stamped with the write time; a bucket this call merely preserves is never re-stamped."
    • addedInput schema / properties / periods / properties
      Added value: +{
      +  "LAST_30_DAYS": {
      +    "description": "Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at).",
      +    "type": "object"
      +  },
      +  "LAST_7_DAYS": {
      +    "description": "Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at).",
      +    "type": "object"
      +  },
      +  "YESTERDAY": {
      +    "description": "Totals-shaped rollup for this window (spend, impressions, clicks, conversions, cpa, ctr, result_indicator, fetched_at).",
      +    "type": "object"
      +  }
      +}
    • changedInput schema / properties / platform / description
      Previous value: -"Platform key: a built-in (``google_ads`` / ``meta_ads`` / ``tiktok_ads`` / ``search_console`` / ``ga4``) or a plugin bridge ``plugin:<dist>``. Use the SAME key the account is already stored under — one ad account has exactly one platform key, and a second key for an account another key already holds is REJECTED (the reporting view sums the entries, so it would double-count)."New value: +"Platform key: a built-in (``google_ads`` / ``meta_ads`` / ``tiktok_ads`` / ``search_console`` / ``ga4``), a platform an installed plugin registered (its provider name), or a plugin bridge ``plugin:<dist>:<provider>``. Use the SAME key the account is already stored under — one ad account has exactly one platform key, and a second key for an account another key already holds is REJECTED (the reporting view sums the entries, so it would double-count). A NEW key that is none of the three is REJECTED too: do not invent or abbreviate a platform name."
    • changedInput schema / properties / totals / description
      Previous value: -"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."New value: +"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. ``fetched_at`` (ISO 8601) is stamped with the write time when you leave it out — or send it null/blank; supply a real one only for figures pulled at some other time."
  4. Changed4 schema fields changedv0.10.43
    • changedInput schema / properties / account_id / description
      Previous value: -"The platform account id (Google customer_id / Meta act_*). Always written onto the platform entry."New value: +"The platform account id (Google customer_id / Meta act_*). Always written onto the platform entry, and used to detect a second entry for the same account."
    • addedInput schema / properties / account_id / minLength
      Added value: +1
    • changedInput schema / properties / platform / description
      Previous value: -"Platform key: a built-in (``google_ads`` / ``meta_ads`` / ``search_console`` / ``ga4``) or a plugin bridge ``plugin:<dist>``."New value: +"Platform key: a built-in (``google_ads`` / ``meta_ads`` / ``tiktok_ads`` / ``search_console`` / ``ga4``) or a plugin bridge ``plugin:<dist>``. Use the SAME key the account is already stored under — one ad account has exactly one platform key, and a second key for an account another key already holds is REJECTED (the reporting view sums the entries, so it would double-count)."
    • addedInput schema / properties / platform / minLength
      Added value: +1
  5. Changed1 schema field changedv0.10.37
    • addedInput schema / additionalProperties
      Added value: +false
  6. Addedv0.10.8

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full behavioral disclosure. It covers atomicity, write behavior (merging per window, preserving omitted fields), automatic fetched_at stamping, the mandatory period_end independent of fetched_at, preservation of other platforms/campaigns, and rejection rules for platform keys and window tokens. This is exceptionally transparent for a state-mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every sentence earns its place given the tool's complexity. It is front-loaded with the core purpose, then layers usage rules, then details caveats (fetched_at, period_end, not_collected). Bold highlights for critical warnings and a logical flow make it navigable despite length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description states the return value ('Returns the updated state document') and covers all edge cases an agent needs: required account_id, period_end necessity, closed window vocabulary, merge semantics, preservation of unrelated data, and the not_collected handling path. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While the schema covers every parameter (100%), the description adds critical cross-parameter semantics: how totals and periods interact, merging behavior per window key, omitted-field preservation, fetched_at stamping rules, and the distinction between period_end and fetched_at. It also specifies that a placeholder account_id is refused and that duplicate platform keys are rejected—insight not fully captured in the schema's individual field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Atomically set a platform's metric ROLLUP in STATE.json's v2 platforms section' and explains the purpose (dashboard rendering without re-querying). It explicitly distinguishes itself from mureo_state_upsert_campaign (per-campaign metrics), so an agent can immediately identify which tool writes platform-level rollups.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance by naming the alternative mureo_state_upsert_campaign for campaign-level metrics and instructing when to use mureo_state_platform_not_collected_set (to clear a not_collected note). It also clarifies that omitted fields and periods are preserved, and that window tokens are a closed set—practical direction for correct invocation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools