Skip to main content
Glama

Account engagement metrics

get_account_metrics
Read-only

Get per-platform engagement (views / likes / comments / shares) as a time series over the trailing window_days (default 28, up to 365). Omit account_id to aggregate across all connected accounts, or pass one from list_accounts; optionally filter to a single platform. post_limit (≤100) fixes how many recent posts form the baseline. granularity buckets the series server-side ('daily' default, 'weekly', or 'raw' for every scrape). Read series (a clean per-platform list of typed points) — metrics is the legacy column/data matrix kept for back-compat. NB: follower counts here are latest-only; for audience growth over time use get_follower_history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformNoOptional platform filter — instagram, tiktok, or youtube (case-insensitive). Omit to span all connected platforms.
account_idNoA connected account_id from list_accounts. Omit to aggregate across all your accounts.
post_limitNoHow many recent posts form the baseline (1–100, default 20; clamped).
granularityNoTime-series bucketing: 'daily' (default), 'weekly', or 'raw' (every scrape).daily
window_daysNoTrailing window in days (1–365, default 28; out-of-range values are clamped).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoPresent only when the requested account_id could not be resolved.
seriesYesPer-platform typed time series.
metricsYesLegacy per-platform {columns, data} matrix (back-compat).
platformYes
platformsYes
account_idYesThe account_id the caller passed (null = all accounts).
post_limitYes
granularityYes
window_daysYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Output of `get_account_metrics`. `reason`='account_not_found' appears\nonly when the requested account_id resolved to none of the caller's\naccounts (then platforms/series/metrics are empty)."
    • addedOutput schema / properties
      Added value: +{
      +  "account_id": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "description": "The account_id the caller passed (null = all accounts)."
      +  },
      +  "granularity": {
      +    "enum": [
      +      "daily",
      +      "weekly",
      +      "raw"
      +    ],
      +    "type": "string"
      +  },
      +  "metrics": {
      +    "additionalProperties": true,
      +    "description": "Legacy per-platform {columns, data} matrix (back-compat).",
      +    "type": "object"
      +  },
      +  "platform": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ]
      +  },
      +  "platforms": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "post_limit": {
      +    "type": "integer"
      +  },
      +  "reason": {
      +    "anyOf": [
      +      {
      +        "const": "account_not_found",
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "default": null,
      +    "description": "Present only when the requested account_id could not be resolved."
      +  },
      +  "series": {
      +    "additionalProperties": {
      +      "items": {
      +        "additionalProperties": true,
      +        "description": "One time-series point. Metric columns (views, like_count,\nfollower_count, ...) are carried as additional properties; `bucket` is\npresent only for 'daily'/'weekly' granularity.",
      +        "properties": {
      +          "bucket": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "description": "Bucket label (ISO date or ISO year-week); absent for granularity='raw'."
      +          },
      +          "timestamp": {
      +            "anyOf": [
      +              {
      +                "format": "date-time",
      +                "type": "string"
      +              },
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "description": "Snapshot time of this point."
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "description": "Per-platform typed time series.",
      +    "type": "object"
      +  },
      +  "window_days": {
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "account_id",
      +  "platform",
      +  "window_days",
      +  "post_limit",
      +  "granularity",
      +  "platforms",
      +  "series",
      +  "metrics"
      +]
  2. Changed5 schema fields changed
    • addedInput schema / properties / account_id / description
      Added value: +"A connected account_id from list_accounts. Omit to aggregate across all your accounts."
    • addedInput schema / properties / granularity / description
      Added value: +"Time-series bucketing: 'daily' (default), 'weekly', or 'raw' (every scrape)."
    • addedInput schema / properties / platform / description
      Added value: +"Optional platform filter — instagram, tiktok, or youtube (case-insensitive). Omit to span all connected platforms."
    • addedInput schema / properties / post_limit / description
      Added value: +"How many recent posts form the baseline (1–100, default 20; clamped)."
    • addedInput schema / properties / window_days / description
      Added value: +"Trailing window in days (1–365, default 28; out-of-range values are clamped)."
  3. Changed1 schema field changed
    • addedInput schema / properties / granularity
      Added value: +{
      +  "default": "daily",
      +  "enum": [
      +    "daily",
      +    "weekly",
      +    "raw"
      +  ],
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations indicate readOnlyHint=true. Description adds that `series` is clean output while `metrics` is legacy, and explains parameter clamping. No contradiction with annotations; adds valuable behavioral context.

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

Conciseness4/5

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

Description is thorough but efficiently front-loaded with main action. Every sentence serves a purpose, though slightly lengthy. Could be trimmed marginally but remains clear.

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?

With output schema present, description still hints at output structure. Covers all aspects: purpose, parameters, alternatives, and behavioral notes. Sufficient for informed agent decision.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. Description adds meaning by explaining 'trailing window_days', granularity options, and that post_limit forms baseline. Provides context beyond schema without redundancy.

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 clearly states the tool retrieves per-platform engagement metrics as a time series, specifying verb (get) and resource (account metrics). It distinguishes from sibling get_follower_history by noting follower counts are latest-only.

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?

Explicit guidance on when to omit account_id for aggregation, filter by platform, and direct to use get_follower_history for audience growth over time. Provides clear usage context and alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.