Skip to main content
Glama

Explain post analytics

explain_post_analytics_state

Diagnostic — returns one of eight concrete states explaining why a post's analytics look the way they do. Use this instead of inferring from raw zeros / nulls in get_post_analytics; it collapses the (platform supports analytics?) × (connection healthy?) × (sync ran?) × (metrics zero?) matrix into a single state plus a human-readable explanation.

Possible states:

  • platform_not_supported: no analytics exist for this platform (Telegram, Discord, WordPress, WhatsApp, Ghost, Blogger, Vimeo). The zero row is a permanent placeholder.

  • account_not_supported: the platform reports nothing for this post and explanation carries the reason: a personal account where only business accounts or pages have analytics (LinkedIn personal profile, personal Pinterest account), an X post when the workspace hasn't added its own X API key, or a Google Business Profile post (Google only has profile-level stats; get_workspace_analytics returns them).

  • connection_needs_reconnect — the token that published this post is expired / revoked; the sync cannot refresh it until the user reconnects.

  • sync_never_ran — no post_analytics row, OR the row is still the publish-time placeholder. No sync has run since the post was published; check the sync field for whether this call started one.

  • sync_failed — the fetch ran and errored out; fetch_error carries the upstream message.

  • synced_zero — real fetch, real zeros. The platform genuinely reports no engagement yet.

  • synced_populated — real fetch, at least one non-zero metric.

  • post_not_published — the post is still a draft or scheduled; no analytics can accrue yet.

Returns actionable: true when there's a user-facing next step (usually reconnect or wait), plus a next_step string spelling it out.

Freshness: if the workspace's analytics were last synced over an hour ago (or never), this call also starts a background sync and reports it in the response's sync field (status started or in_progress, plus last_synced_at). The numbers in that response are from the previous sync; call again in a few minutes for fresh ones. sync.status of free_plan_limit or daily_limit means no sync could run, so the numbers may not be current.

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": {
      "video_post_id": "<video_post_id>"
    },
    "name": "explain_post_analytics_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
video_post_idYesThe video_posts.id to diagnose. Get it from list_video_uploads or the return value of other analytics tools.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false, openWorldHint=true, destructiveHint=false but say nothing about why this is not read-only; the description explains the write side effect ('this call also starts a background sync and reports it in the response's sync field'). It also discloses freshness semantics ('the numbers in that response are from the previous sync; call again in a few minutes'), rate-limit outcomes ('free_plan_limit' or 'daily_limit' means no sync could run, so the numbers may not be current'), and where error text surfaces (fetch_error). This is context annotations cannot carry.

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?

The diagnostic framing and sibling routing are front-loaded before the state table, and the bullet list is scannable rather than prose. It is long, but the length is driven by enumerating eight states an agent must distinguish; a few parenthetical platform lists could be trimmed without losing the routing value.

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?

There is no output schema, so the description carries the return-value burden and does so: it names the state, explanation, actionable, next_step, sync, and fetch_error fields. For a diagnostic tool with a background-sync side effect, an agent has everything needed to call it, read the result, and know whether to call again.

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?

With one parameter and 100% schema description coverage, the baseline is 3; this exceeds it by naming the semantic distinction that the schema cannot — that the ID is a video_posts.id drawn from list_video_uploads or from other analytics tool return values. It also clarifies that the ID identifies the post whose analytics, not sync, are being diagnosed.

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+resource framing ('Diagnostic — returns one of eight concrete states explaining why a post's analytics look the way they do') and immediately distinguishes itself from the closest sibling, get_post_analytics. An agent can tell from the first sentence which tool to reach for.

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?

It gives an explicit routing rule: 'Use this instead of inferring from raw zeros / nulls in get_post_analytics,' and frames the tool as collapsing a four-axis matrix that would otherwise be guessed at. The enumeration of when each state applies (unsupported platform, personal account, expired token, no sync, failed fetch, genuine zeros, draft post) functions as concrete per-scenario guidance.

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.