Skip to main content
Glama

Query trends

query_trends
Read-onlyIdempotent

Metrics over time: event counts, unique users or sessions, the sum, average or p95 of a numeric property, optionally split by a property (one breakdown for every series, or each series by its own) and compared to the previous period. The workhorse for "how many / how much / is it growing" questions. interval "total" returns one de-duplicated number per series for the whole window.

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": {
      "series": "<series>"
    },
    "name": "query_trends"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoWindow end, ISO 8601. Default now.
fromNoWindow start, ISO 8601 (e.g. "2026-09-01" or "2026-09-01T12:00:00Z").
lastNoRelative window ending now, e.g. "1h", "24h", "7d", "30d", "90d". Default "14d". Ignored when `from` is given.
seriesYesOne to five metrics. Each: {event, aggregation, property?, filters?, label?, breakdown?}. `property` is required for sum, avg and p95.
compareNoAlso compute the previous period of equal length.
filtersNoFilters combined with AND/OR: {combinator: "AND", filters: [{property: {scope, key}, op, values: [..]}], groups: [nested groups]}. Ops: eq, neq, in, contains, gt, lt, is_set. Values are strings.
projectNoProject handle (as in list_projects) or id. Optional when this connection is limited to one project or the workspace has only one.
intervalNoBucket size. Default chosen from the window (hour ≤2d, day ≤120d, week beyond).
projectsNoProject handles (as in list_projects) or ids, to read across several apps. Leave out for every project this connection can reach. For one project use `project`; never pass both.
breakdownsNoSplit every series without its own `breakdown` by one property.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / breakdowns / description
      Previous value: -"Split every series by one property."New value: +"Split every series without its own `breakdown` by one property."
    • changedInput schema / properties / series / description
      Previous value: -"One to five metrics. Each: {event, aggregation, property?, filters?, label?}. `property` is required for sum, avg and p95."New value: +"One to five metrics. Each: {event, aggregation, property?, filters?, label?, breakdown?}. `property` is required for sum, avg and p95."
    • addedInput schema / properties / series / items / properties / breakdown
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "{scope, key}. scope \"event\" = payload property, \"context\" = built-in dimension (country, browser, page_path, utm_source…), \"session\", \"user\" = user trait.",
      +  "properties": {
      +    "key": {
      +      "maxLength": 1000,
      +      "type": "string"
      +    },
      +    "scope": {
      +      "enum": [
      +        "event",
      +        "context",
      +        "session",
      +        "user"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "scope",
      +    "key"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish readOnly/idempotent/non-destructive, so safety needs no restating. The description still adds behavior the annotations and schema do not: interval 'total' yields one de-duplicated number per series for the whole window, and breakdown/breakdowns controls whether each series splits on its own dimension or shares one. That is genuine extra context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences: the aggregation surface first, the use-case framing second, the special-case interval semantics last. No filler, and the most decision-relevant content is front-loaded.

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 10-parameter tool with deeply nested filter/breakdown objects and no output schema, the description is strong on query semantics but says nothing about the returned series shape or result-size limits. The interval 'total' note partly compensates for the absent output schema, keeping this at a solid but not complete 4.

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 baseline is 3 for the parameter list. The description goes beyond it by disambiguating the two breakdown mechanisms ('one breakdown for every series, or each series by its own') and by clarifying 'total' semantics against the interval enum, adding meaning the schema alone doesn't convey.

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?

The description names the resource (time series metrics) and enumerates exactly what is computed — event counts, unique users/sessions, sum/avg/p95 of a numeric property — which is specific enough to separate it from query_funnel and query_retention. It never names those siblings, though, so differentiation is inferred from the word 'over time' rather than stated.

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?

'The workhorse for how many / how much / is it growing questions' gives real usage context and points toward comparison/growth framing. However, it offers no when-not guidance and never routes the agent to query_funnel, query_retention, or run_sql for the cases those handle, so the sibling choice is left to inference.

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.