Skip to main content
Glama

Run a custom insight query

analytics_insights_query
Read-onlyIdempotent

[read-only] Read-only analytics query: one metric aggregated (median by default) over posts, broken down by up to a few dimensions (platform, weekday, hour, brand, campaign, postType, label:, arm), at a fixed post age window (48h / 7d / 30d / lifetime) so posts are compared fairly. Every row carries its sample size n; platforms that do not report the metric are listed in availability, never counted as 0. Pro plan or higher. Was query_insights (still callable for one release). Full description and schema: describe_tool {"name":"analytics_insights_query"}. (Wraps POST /api/v2/insights/query.)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analytics_insights_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateToNoe.g. "2026-11-20". ISO date or epoch ms. Default: now.
formatNoe.g. "json".json
metricNoe.g. "impressions". Metric to measure. One of 19 values, e.g. "impressions", "views", "engagement".impressions
windowNoe.g. "48h".7d
brandIdNoe.g. "brandId_123".
filtersNoe.g. {"labels":["campaign:summer"]}. Fields: labels, excludeLabels, campaignId, experimentId, platforms.
formulaNoe.g. {"series":{"A":{"metric":"impressions"}},"expression"… Fields: series, expression, format.
dateFromNoe.g. "2026-11-01". ISO date or epoch ms (publish time).
intervalNoe.g. "day". Adds a time series bucketed by publish date.
breakdownNoe.g. ["Example"].
aggregationNoe.g. "sum".median
tzOffsetMinutesNoe.g. 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world behavior. The description adds real context beyond that: every row carries its sample size n, unavailable platforms are surfaced in `availability` rather than counted as 0, and the endpoint wraps a POST despite being read-only. It omits rate limits, pagination, and response size limits.

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 core capability and its scoping constraints are front-loaded in the first sentence, with prerequisites and migration notes trailing. It is dense with parentheticals and runs long, but nearly every clause carries information an agent needs.

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

Completeness4/5

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

For a 12-parameter tool with nested objects and no output schema, the description covers the key semantics: metric aggregation, window fairness, sample size, availability handling, and the plan requirement. It stops short of explaining the row shape or how `interval` time-series buckets interact with the fixed window, which would be the remaining gap.

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 coverage is 100%, so the baseline is 3, but the description earns more by enumerating the valid `breakdown` values (platform, weekday, hour, brand, campaign, postType, label:<key>, arm) — detail the schema leaves as a bare string array with a placeholder example. It also clarifies the default aggregation (median) and the fixed window semantics, though metric/date parameters get no extra detail.

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 names the specific operation — a read-only analytics query aggregating one metric over posts, broken down by dimensions, at a fixed post-age window — with concrete examples of the dimensions and windows. An agent can tell this is the custom/flexible insight query tool rather than a simple metrics fetch, without opening the schema.

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

Usage Guidelines3/5

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

It states a prerequisite ("Pro plan or higher") and a migration note ("Was query_insights, still callable for one release"), and points to describe_tool for full detail. However, it never says when to use this over the sibling analytics_get or when a simpler query suffices, so the when-to-use guidance is only implied.

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.

Resources