Skip to main content
Glama

query

Read-only

Run a flexible ad-hoc analytics query with custom metrics, filters, grouping, date ranges, and privacy-first customer email lookup. This is the most powerful endpoint — use it when other tools don't answer the question.

Examples of questions this tool answers:

  • "How many signups from Germany this week?" → filters: [{field:"event",op:"eq",value:"signup"},{field:"country",op:"eq",value:"DE"}]

  • "Which events contain 'page' in the name?" → filters: [{field:"event",op:"contains",value:"page"}], group_by: ["event"]

  • "Daily unique users for the last 30 days" → metrics: ["unique_users"], group_by: ["date"], date_from: "30d"

  • "Events per country" → group_by: ["country"]

Filter operators: eq, neq, gt, lt, gte, lte, contains Filterable fields: event, user_id, date, country, session_id, timestamp, and any properties.* field (e.g. properties.path) For customer-specific reads, use the top-level email input instead of hashing locally. Raw email is sent only in the authenticated HTTPS POST body; the server matches via a project-scoped HMAC index and does not store raw email in event rows or profile traits. Built-in fields are a closed list. Event properties such as referrer, utm_source, path, browser, and hostname must be queried as properties.referrer, properties.utm_source, properties.path, properties.browser, and properties.hostname. Invalid filter fields fail loudly and return /properties-style guidance instead of being silently ignored. Group by: event, date, user_id, session_id, country Metrics: event_count, unique_users, session_count, bounce_rate, avg_duration Count modes: raw, session_then_user. The default for event_count is session_then_user for activation-safe counting: session-backed rows count by session, no-session rows fall back to user only when that user has no session-backed row in the same group, and fully anonymous rows fall back to event id. count_mode is ignored when event_count is not requested.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailNoFilter by server-side scoped HMAC email lookup. Raw email is sent only in the authenticated HTTPS POST body and is not stored in event rows or profile traits.
limitNoMax results (default 100, max 1000)
orderNoSort directiondesc
date_toNoEnd date (ISO 8601). Defaults to today.
filtersNoFilters to apply
metricsNoMetrics to compute
projectYesProject name
group_byNoFields to group results by
order_byNoField to sort by
date_fromNoStart date (ISO 8601 or Nd shorthand like '30d'). Defaults to 7 days ago.
count_modeNoHow event_count is aggregated. Default for event_count: session_then_user. Session-backed rows count by session, no-session rows fall back to user only when that user has no session-backed row in the same group, and fully anonymous rows fall back to event id. Ignored for queries without event_count. Use raw for ingestion/debugging counts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With annotations already declaring readOnlyHint=true, openWorldHint=false, and destructiveHint=false, the description adds substantial behavioral context. It explains the privacy-first email lookup, states that raw email is sent only in the authenticated HTTPS POST body and not stored in event rows or profile traits, notes that invalid filter fields fail loudly, and details count_mode fallback semantics. These are meaningful operational traits beyond the annotations.

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 long but front-loaded: it begins with purpose and usage guidance, then examples, then parameter and behavioral details. For an 11-parameter analytics query tool with no output schema, most of the length earns its place, though some parameter details are repeated from the schema and the phrase 'the most powerful endpoint' is subjective. It is comprehensive but not maximally tight.

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?

Given the tool's complexity, the 11-parameter schema, and the absence of an output schema, the description is complete enough for an agent to call it correctly. It covers purpose, usage context, examples, filter syntax, field naming rules, privacy behavior, grouping, metrics, and count modes. Nothing critical appears to be missing for correct invocation.

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 the baseline is 3, but the description adds useful meaning beyond the schema. It lists filter operators and filterable fields, clarifies that event properties must be queried as properties.referrer, properties.utm_source, etc., and provides concrete examples showing how filters, group_by, metrics, and date_from combine. Some parameter details are duplicated by the schema, but the examples and closed-list clarification add real value.

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 states a specific verb and resource: 'Run a flexible ad-hoc analytics query' with custom metrics, filters, grouping, date ranges, and email lookup. It also distinguishes this tool from siblings by calling it 'the most powerful endpoint' and saying to use it 'when other tools don't answer the question.' An agent can immediately understand what this tool does and how it differs from the surrounding analytics tools.

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

Usage Guidelines4/5

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

It gives clear usage context: use this when other tools don't answer the question, and it provides concrete example questions. However, it does not name specific sibling alternatives or explicit when-not scenarios beyond the general 'other tools' framing. The guidance is clear but not maximally explicit.

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