Skip to main content
Glama

nevent_analytics_query

Read-only

Query event marketing analytics. Supports dimensions, metrics, time ranges, and filters across campaigns, purchases, fans (user_tenants), and more. MANDATORY RULES: (1) ALWAYS call nevent_analytics_table_schema BEFORE querying to discover exact field names. NEVER guess field names. (2) For BOOLEAN fields, use operator "eq" (or "neq") with the boolean value true or false; "is_true"/"is_false" are segmentation operators and analytics rejects them. (3) For enum fields (state, status), check the field description for valid values. Common values: purchases.state = SUCCEEDED|COMPLETE|PENDING|FAILED; campaigns.status = EXECUTED|DRAFT|PAUSED|STOPPED.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ctesNoCTE (Common Table Expression) sub-queries — v3.19.0+
sortNoSort the result rows. Accepts a single { field, order } object or an array for multi-field sorting.
limitNoMaximum rows to return (max 1000, default 100)
dryRunNoDry-run mode: estimate query cost without executing (v3.19.0+). Response includes estimatedBytes in metadata.
havingNoHAVING clause filters to apply after aggregation
filtersNoWHERE clause filters to apply before aggregation
groupByNoCalendar-based group-by fields (v3.19.0+). Known values: dayOfWeek | weekOfYear | hourOfDay | minuteOfHour | month | quarter | year
metricsNoAggregated metrics to compute (SUM, COUNT, etc.)
distinctNoAdd SELECT DISTINCT to deduplicate result rows (v3.19.0+)
timeRangeNoTime range filter with optional granularity for trend analysis
collectionYesCollection name, e.g. "purchases", "tickets", "campaigns"
dimensionsNoFields to group by (SELECT dimensions). Omit for aggregate-only queries.
sourceTableNoCTE name to use as source instead of a raw collection — v3.19.0+
comparePeriodsNoPeriod-over-period comparison (YoY, MoM, etc.) — v3.19.0+
timeGranularityNoTime granularity for bucketing (v3.19.0+). Known values: day | week | month | quarter | year | hour | minute | fiscalQuarter | fiscalYear
compareDimensionsNoComparative dimension analysis configuration

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / filters / items / properties / operator / description
      Previous value: -"Comparison operator. Known values: eq | neq | gt | gte | lt | lte | in | not_in | like | contains | not_contains | starts_with | ends_with | regex | between | is_null | is_not_null | is_true | is_false | array_contains | array_contains_any"New value: +"Comparison operator. Valid values depend on the field type (nevent_analytics_capabilities lists them): eq | neq | gt | gte | lt | lte | in | nin | contains | not_contains | starts_with | ends_with | regex | regex_i | before | after | between | in_range | not_in_range | is_empty | is_not_empty | exists. BOOLEAN fields: eq or neq with true/false."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare readOnlyHint and destructiveHint false, so it's safe. The description adds important behavioral context: the mandatory schema lookup, operator restrictions for booleans (eq/neq vs is_true), and enum value conventions. It also mentions dryRun mode and versioned features (v3.19.0+), which goes beyond annotations to clarify behavior.

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 moderately long but well-structured with mandatory rules clearly numbered and bolded. It front-loads the most critical instruction (call table schema first) and provides concise examples. Slightly verbose but justified by the complexity of the tool and the need to prevent errors.

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?

Given the tool's complexity (16 params, nested objects, no output schema), the description covers essential usage patterns but does not fully document all parameters (e.g., CTEs, comparePeriods) or return format. However, it directs the agent to schema and capabilities tools for further details, and the mandatory rule prevents guesswork. It's fairly complete for avoiding misuses, though lacks some detail on advanced features.

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 schema already describes all parameters. But the description adds crucial semantics: for boolean fields it specifies eq/neq with true/false, not is_true/is_false, and for enums it lists common values for purchases.state and campaigns.status. This supplements the schema and helps the agent avoid common mistakes.

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 clearly states it queries event marketing analytics with dimensions, metrics, time ranges, and filters across campaigns, purchases, and fans. It distinguishes itself from siblings like nevent_campaign_report and nevent_get_campaign_metrics by focusing on the generic analytics query endpoint. However, it does not explicitly name the sibling it replaces or differs from, but the use case is clear.

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

Usage Guidelines5/5

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

Provides explicit mandatory rules: ALWAYS call nevent_analytics_table_schema first to get exact field names, never guess field names, and gives specific operator guidance for boolean and enum fields. This clearly tells the agent when and how to use this tool, including prerequisites and common value examples.

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.