Skip to main content
Glama

ga4_run_report

Run custom Google Analytics 4 Data API reports with selected dimensions, metrics, filters, and sorting to retrieve report rows for analysis and reporting.

Instructions

Run any GA4 Data API report. Dimensions and metrics use API names (see ga4_metadata), e.g. dimensions ["eventName","platform"], metrics ["eventCount","totalUsers"]. Filters and orderBys use the Data API JSON shape. 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
limitNoMax rows (default 1000)
offsetNoRow offset for paging
totalsNoAlso return the total row
metricsYesMetric API names
end_dateYesEnd date: YYYY-MM-DD, or relative like "today"
propertyNoSaved property name (see ga4_list_properties). Defaults to the default property.
order_bysNoData API OrderBy list, e.g. [{"metric":{"metricName":"totalUsers"},"desc":true}]
dimensionsNoDimension API names
start_dateYesStart date: YYYY-MM-DD, or relative like "7daysAgo", "yesterday", "today"
metric_filterNoData API FilterExpression for metrics, e.g. {"filter":{"fieldName":"totalUsers","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"100"}}}}
dimension_filterNoData API FilterExpression for dimensions, e.g. {"filter":{"fieldName":"eventName","stringFilter":{"matchType":"BEGINS_WITH","value":"Checkout_"}}}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A3.8/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 discloses hard prerequisites (analyticsdata.googleapis.com enabled on the quota project, Lector/Viewer role on the property) and the failure behavior (access errors explain how to fix themselves; ga4_check_access validates everything at once). It omits return-row shape and any rate/quota limits, and "Run" only implicitly signals a read-only operation.

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?

Dense and front-loaded: capability, naming convention, filter shape, and prerequisites in four compact sentences. The mid-sentence language switch to Spanish ("Lector (Viewer) en la propiedad de GA4") is a small readability blemish in an otherwise efficient definition.

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 an 11-parameter tool with nested filter objects and no output schema, the definition covers auth prerequisites, field-naming conventions, error recovery, and cross-tool helpers. The remaining gap is what a response row looks like and how limit/offset paging interacts with totals, but the schema covers those parameters individually.

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; the description earns a 4 by establishing that dimensions and metrics take API names (not display names) rather than free text, and by routing the agent to ga4_metadata to discover valid names — real semantics the schema does not supply. Filters and orderBys are only told to follow "the Data API JSON shape," which the schema already exemplifies.

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?

"Run any GA4 Data API report" gives a specific verb (run) and resource (GA4 Data API report), and the word "any" signals this is the generic escape hatch versus the numerous specialized siblings (ga4_top_events, ga4_realtime_report, ga4_pivot_report, ga4_event_counts). It never explicitly names those siblings as alternatives, so the boundary is inferred 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 description points to ga4_metadata for valid dimension/metric names and to ga4_check_access when access errors occur, giving useful pre-call and troubleshooting guidance. However, it does not say when to prefer this generic report tool over the ~30 specialized report siblings, which is the main selection decision an agent faces here.

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