Skip to main content
Glama

analytics_query

Read-onlyIdempotent

Query product analytics. Filter by event name and time range; group by hour, day, event, or user. Returns aggregated counts and numeric sums.

Example:

{
  "project_id": "my-saas",
  "event": "purchase_completed",
  "from": "2026-04-01",
  "to": "2026-04-20",
  "group_by": "day"
}
// Returns: [{ "date": "2026-04-01", "count": 12, "sum_amount": 587.88 }, ...]

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": {
      "project_id": "<project_id>"
    },
    "name": "analytics_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOptional end time — ISO-8601 string or unix-ms integer.
fromNoOptional start time — ISO-8601 string or unix-ms integer.
eventNoOptional event name to filter on. If omitted, all events match.
limitNoMax rows (default 1000, max 10000).
group_byNoOptional. One of: hour, day, event, user. Omitted: raw event rows (most recent first).
project_idYesProject ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety is covered; the description adds genuine value beyond them by documenting the return payload (aggregated counts and numeric sums) and, via the example, the exact row shape per group_by. It does not mention rate limits, result-size caps beyond what the schema states, or what happens for very wide ranges — minor gaps.

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?

Two tight sentences front-load the purpose and capabilities, followed by a compact example. The example is the only documentation of the return shape (there is no output schema), so it earns its place, though several of its keys simply restate fields the schema already documents.

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 read-only 6-parameter query tool with no output schema, the description covers purpose, grouping semantics, and return shape well enough to call it correctly. Remaining gaps — pagination/limit interaction with grouping, and behavior on unknown events or empty ranges — are modest but real.

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%, so the schema already explains every parameter including the group_by enum values and the project_id resolution rules. The description reinforces group_by's options and shows a realistic call, but adds no format or edge-case meaning the schema lacks; baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Query product analytics") and enumerates its capabilities: event/time filtering, grouping by hour/day/event/user, and aggregated counts plus numeric sums. It is clear what the tool does, but it never distinguishes itself from likely siblings such as analytics_track (writing events) or db_query (raw rows), so the agent must infer the boundary.

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?

Usage is implied by the capability list — filter with event/from/to, aggregate with group_by — but there is no explicit when-to-use or when-not-to-use statement and no named alternative tool. The agent can figure out the intended call shape, yet nothing prevents it from choosing db_query for an equivalent task.

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