Skip to main content
Glama

Run GA4 report

run_report
Read-only

Run a GA4 report via the Data API. Dimensions × metrics over a date range, with optional dimensionFilter/metricFilter (GA4 FilterExpression objects), orderBys, offset pagination, and multiple dateRanges. Example: device usage by page = dimensions [pagePath, deviceCategory], metric [screenPageViews]. GA4 allows at most 4 dateRanges per run_report call - split more into separate calls and combine the results. GA4 counts dimensions referenced in dimensionFilter toward the 9-dimension nested-request limit, on top of the dimensions array - reduce the dimensions requested or simplify the filter. A numericFilter needs its comparison value wrapped as { int64Value: '10' } (string) or { doubleValue: 10.5 }, not a bare number - e.g. { fieldName: 'sessions', numericFilter: { operation: 'GREATER_THAN', value: { int64Value: '10' } } }. A bare value: 10 passes schema validation here but GA4 rejects it at request time with "value is missing from NumericFilter" since it never finds anything under int64Value/doubleValue.

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": {
      "dimensions": "<dimensions>",
      "metrics": "<metrics>"
    },
    "name": "run_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
offsetNoRow offset for pagination.
endDateNotoday
metricsYese.g. ['screenPageViews','activeUsers']
orderBysNo
propertyNoGA property id, e.g. 'properties/123'. Defaults to the connection's.
startDateNo28daysAgo
dateRangesNoOverrides startDate/endDate; supports multiple ranges.
dimensionsYese.g. ['pagePath','deviceCategory']
metricFilterNoGA4 FilterExpression OBJECT on metrics (not a JSON string). Omit it for no filter; never pass {}. Same shape as dimensionFilter, with numeric values wrapped as { int64Value: '10' }.
keepEmptyRowsNo
dimensionFilterNoGA4 FilterExpression OBJECT on dimensions (not a JSON string). Omit it for no filter; never pass {}. Needs one of filter, andGroup, orGroup or notExpression at the top level, e.g. { filter: { fieldName: 'pagePath', stringFilter: { matchType: 'CONTAINS', value: '/blog' } } }.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / dimensionFilter / description
      Previous value: -"GA4 FilterExpression on dimensions (pass-through)."New value: +"GA4 FilterExpression OBJECT on dimensions (not a JSON string). Omit it for no filter; never pass {}. Needs one of filter, andGroup, orGroup or notExpression at the top level, e.g. { filter: { fieldName: 'pagePath', stringFilter: { matchType: 'CONTAINS', value: '/blog' } } }."
    • changedInput schema / properties / metricFilter / description
      Previous value: -"GA4 FilterExpression on metrics (pass-through)."New value: +"GA4 FilterExpression OBJECT on metrics (not a JSON string). Omit it for no filter; never pass {}. Same shape as dimensionFilter, with numeric values wrapped as { int64Value: '10' }."
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint/destructiveHint, so they say nothing about server-side constraints. The description adds substantial behavior: the 4-dateRange cap, the 9-dimension nested-request limit counting filter-referenced dimensions, and the specific failure mode where a bare numeric value passes schema validation but GA4 rejects it at request time with 'value is missing from NumericFilter'. That last point is exactly the kind of runtime behavior an agent cannot get from any structured field.

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?

Front-loaded with purpose and the request shape, then escalating into specific pitfalls, which is the right order. It loses a point for redundancy: the numericFilter wrapping rule is stated once as a rule with an example, then restated with the quoted GA4 error message, spending a full sentence on the same constraint.

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 12-parameter tool with no output schema, the description covers the genuinely dangerous request-side semantics well. It does not describe the response at all (rows, dimension/metric headers, row count interplay with limit), which an agent inspecting return values would need, and it leaves property defaulting and keepEmptyRows unaddressed.

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?

With only 58% schema description coverage, the description carries real weight and does: it gives a worked example mapping dimensions [pagePath, deviceCategory] to metric [screenPageViews], specifies that dimensionFilter/metricFilter must be objects (never a JSON string, never {}), and shows the exact int64Value/doubleValue wrapping required for numericFilter. Gaps remain on limit/offset interaction and keepEmptyRows, so it does not fully compensate for the missing schema coverage.

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: 'Run a GA4 report via the Data API', then qualifies it as 'Dimensions × metrics over a date range', which pins down the core-reporting shape. It never names the sibling tools (run_realtime_report, run_funnel_report) to contrast against, so differentiation is inferable from the request shape 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?

Gives concrete operational guidance for edge cases ('GA4 allows at most 4 dateRanges per run_report call - split more into separate calls and combine the results', and reducing dimensions when the 9-dimension limit is hit), which is real when-to-use advice. However, it offers no guidance on when to choose this tool over run_realtime_report or run_funnel_report, leaving the main selection question unanswered.

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