Skip to main content
Glama

Query Analytics

query_analytics
Read-only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days of snapshots to look back (default 7). Use `days=0` to fetch only the most recent snapshot — which under the daily-window collector covers yesterday UTC. This is the right call for the setup-time "show the user a sample of yesterday's data" flow, since it matches what the scheduled digest will show. Ignored for metric="digest_view".
metricYesOne of "traffic", "sources", "top_pages", "top_clicks", "engagement", "daily_digest", "digest_view", "custom". Use "digest_view" to read exactly what the user sees on this agent's Analytics Output tab — the derived today + history entries (each with week-over-week deltas) + PostHog link; the other metrics return raw snapshot data.
custom_queryNoRaw HogQL SQL query (only for metric="custom"). Must be a valid SELECT statement, e.g. "SELECT properties.$pathname as path, count() as views FROM events WHERE event = '$pageview' GROUP BY path ORDER BY views DESC LIMIT 10". Do NOT pass natural language — this is sent directly to the PostHog query API.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / metric / description
      Previous value: -"One of \"traffic\", \"sources\", \"top_pages\", \"top_clicks\", \"engagement\", \"daily_digest\", \"digest_view\", \"custom\". Use \"digest_view\" to read exactly what the user sees on this task's Analytics Output tab — the derived today + history entries (each with week-over-week deltas) + PostHog link; the other metrics return raw snapshot data."New value: +"One of \"traffic\", \"sources\", \"top_pages\", \"top_clicks\", \"engagement\", \"daily_digest\", \"digest_view\", \"custom\". Use \"digest_view\" to read exactly what the user sees on this agent's Analytics Output tab — the derived today + history entries (each with week-over-week deltas) + PostHog link; the other metrics return raw snapshot data."
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

The readOnlyHint annotation already covers the safety profile, so the description is not required to restate it. The description adds only that data comes from PostHog and returns a Dict, but does not disclose data freshness, rate limits, or external dependencies. This is adequate but minimal given the annotation coverage.

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 description is short and front-loaded with a clear summary followed by a return type. It has no filler, though the return statement adds little beyond what the name implies. Still, it is appropriately concise for a tool whose schema is highly self-descriptive.

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?

There is no output schema, but the description states the return type as a Dict. All parameters are fully documented in the input schema, including the metric enum and the special days=0 behavior. The description is complete enough given the rich schema and readOnly annotation.

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

Parameters3/5

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

Schema description coverage is 100% with detailed explanations for days, metric, and custom_query. The description itself adds no parameter-level semantics, so the baseline of 3 is appropriate since the schema carries the full burden.

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 'Query the user's website analytics from PostHog' uses a specific verb ('query'), names the resource ('user's website analytics'), and identifies the source ('PostHog'). This clearly differentiates it from other query_* siblings like query_people or query_prospects.

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

Usage Guidelines2/5

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

The description gives no guidance on when to choose this tool over alternatives, nor does it mention exclusions or when not to use it. Although the schema hints at metric-specific use cases, the main description lacks any explicit routing or usage context.

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