Skip to main content
Glama

Site Insights by KKV Labs

GA4 pivot report

run_ga4_pivot_report
Read-onlyIdempotent

GA4 Data API runPivotReport: dimensions and metrics with one or more pivots (fieldNames, limit, offset, orderBys, metricAggregations), filters and comparisons. Returns Google's pivot headers and every row.

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": {
      "pivots": "<pivots>"
    },
    "name": "run_ga4_pivot_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawNotrue returns Google's response exactly as Google sent it, unchanged.
siteNoThe site's domain (example.com) or its label. Optional when the account has exactly one site switched on. An unknown name returns an error that lists the switched on sites.
limitNoRows to return, default 1000, up to Google's 250000.
offsetNoRow offset for the next page.
periodNoDate range. Default last_28_days. Named ranges end when the data is complete.
pivotsYesGA4 Pivot objects, for example [{ "fieldNames": ["deviceCategory"], "limit": 5 }]. Google requires every requested dimension to appear in exactly one pivot's fieldNames.
metricsNo
end_dateNoCustom end date YYYY-MM-DD.
order_bysNoGA4 OrderBy objects, for example [{ "metric": { "metricName": "sessions" }, "desc": true }].
dimensionsNo
start_dateNoCustom start date YYYY-MM-DD. Overrides period.
comparisonsNoGA4 Comparison objects (name plus dimensionFilter, or a saved comparison).
date_rangesNoUp to 4 GA4 date ranges. Dates are YYYY-MM-DD, today, yesterday or NdaysAgo. Overrides period.
currency_codeNo
metric_filterNoGA4 FilterExpression applied to metrics after aggregation.
keep_empty_rowsNo
dimension_filterNoGA4 FilterExpression for dimensions (andGroup, orGroup, notExpression, filter with stringFilter, inListFilter, numericFilter, betweenFilter, emptyFilter), as in the GA4 Data API.
metric_aggregationsNoGA4 metricAggregations. Default TOTAL.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety is covered. The description adds one genuinely useful behavioral fact beyond them — that the result is Google's pivot headers plus every row, i.e. the raw GA4 response shape. It omits other behavior an agent would want, such as how the 250000 row cap and paging interact or what 'raw' changes.

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?

Two tight sentences with no filler; the operation and the return shape are front-loaded. The parenthetical parameter list is somewhat redundant given the schema, which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 18 parameters, nested GA4 objects and no output schema, the description covers the operation and return shape but leaves the interaction between period, start_date/end_date and date_ranges, plus the site and raw flags, entirely to the schema. Adequate, not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 78%, so the schema already explains most parameters well. The description's parenthetical (fieldNames, limit, offset, orderBys, metricAggregations) largely repeats names already documented in the schema and adds no new meaning, so the baseline of 3 applies.

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 (GA4 Data API runPivotReport) and enumerates the pivot-shaping inputs, so an agent can tell it produces a pivoted GA4 report rather than a flat one. It stops short of explicitly contrasting itself with run_ga4_report, but the pivot emphasis is distinctive enough.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says to pick this over run_ga4_report, run_ga4_batch_reports or run_ga4_realtime_report, and no prerequisites or exclusions are given. Usage is only inferable from the word 'pivots' in the description and the required 'pivots' parameter.

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