Skip to main content
Glama

ga4_event_counts

Get event counts and unique users for selected events or a prefix, with optional time granularity and dimension splits such as platform or country.

Instructions

Event count and unique users for a list of events (or every event starting with a prefix), optionally over time (day, ISO week or month) and split by one more dimension such as platform or country. Unique users are deduplicated within each period, so they cannot be summed across periods. Requires: Google Analytics Data API (analyticsdata.googleapis.com) enabled on the quota project; Lector (Viewer) en la propiedad de GA4. If it fails for access, the error explains how to fix it; ga4_check_access checks everything at once.

Input Schema

NameRequiredDescriptionDefault
eventsNoExact event names
prefixNoEvent name prefix, e.g. "Checkout_". Used when events is empty
end_dateYesEnd date: YYYY-MM-DD, or relative like "today"
propertyNoSaved property name (see ga4_list_properties). Defaults to the default property.
split_byNoExtra dimension API name, e.g. "platform", "country", "appVersion"
start_dateYesStart date: YYYY-MM-DD, or relative like "7daysAgo", "yesterday", "today"
granularityNoTime groupingnone

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it warns that unique users are deduplicated per period and cannot be summed across periods, and it states the API-enablement and Viewer-role requirements plus the self-diagnosing error behavior. It omits row limits, cost/quota behavior, and what the response payload looks like.

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?

Core behavior is front-loaded in the first sentence and the caveat about deduplication follows immediately, which is the right order. There is minor clutter in the mixed-language access clause ('Lector (Viewer) en la propiedad de GA4') and the requirements tail could be tighter.

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 seven parameters, no output schema, and no annotations, the definition covers the essential semantics: what is counted, how periods and splits work, the deduplication trap, and the access preconditions. Missing only secondary details such as response shape and result-size limits, which an agent would likely need on first call.

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 baseline is 3, but the description adds genuine meaning: the events-vs-prefix relationship, the day/ISO-week/month grouping including ISO semantics, and the notion of splitting by one additional dimension such as platform or country. It does not add format details for dates or dimension names beyond the schema examples.

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 exact metrics (event count and unique users), the scope (a list of events or a prefix), and the optional time/dimension breakdowns, so the resource is unambiguous. It does not explicitly distinguish itself from siblings that could also return event figures (ga4_top_events, ga4_run_report), which keeps it short of a 5.

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 real usage context: prerequisites for the API and property access, a note that failures self-explain, and an explicit pointer to ga4_check_access as the alternative for diagnosing access. It stops short of saying when to pick this over ga4_top_events or ga4_run_report.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.