Skip to main content
Glama
Akxan
by Akxan

GA4 pivot report

ga_run_pivot_report
Read-onlyIdempotent

Cross-tab one GA4 dimension against another (e.g., landing pages by device) and return a matrix with row totals. Specify row/column dimensions and metrics; the tool builds the pivot report automatically.

Instructions

Cross-tab one dimension against another, e.g. landing pages (rows) by device category (columns) with sessions. Simpler than the raw API: give rowDimension, columnDimension and metrics; the tool builds the two pivots and returns a matrix plus row totals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoyesterday
metricsNo
rowLimitNo
rowOffsetNoSkip this many values of the row dimension (pagination).
startDateNo28daysAgo
propertyIdYesGA4 property ID, e.g. '123456789' (see ga_list_properties).
columnLimitNo
filterLogicNoHow to join several dimensionFilters.and
rowDimensionNolandingPage
columnDimensionNodeviceCategory
dimensionFiltersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.10.0
    • addedInput schema / properties / dimensionFilters / items / properties / value / description
      Added value: +"Single value, matched with matchType."
    • addedInput schema / properties / dimensionFilters / items / properties / values
      Added value: +{
      +  "description": "Match any value in this list (inListFilter), e.g. 20 page paths. Use instead of value.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / dimensionFilters / items / required
      Previous value: -[
      -  "field",
      -  "value"
      -]New value: +[
      +  "field"
      +]
    • addedInput schema / properties / filterLogic
      Added value: +{
      +  "default": "and",
      +  "description": "How to join several dimensionFilters.",
      +  "enum": [
      +    "and",
      +    "or"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rowOffset
      Added value: +{
      +  "default": 0,
      +  "description": "Skip this many values of the row dimension (pagination).",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Addedv0.5.1

TDQS

B3.4/5.0
Behavior3/5

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

With annotations already declaring readOnlyHint, idempotentHint, and destructiveHint=false, the safety profile is covered. The description adds useful behavioral context by promising a matrix plus row totals and saying the tool builds the two pivots, but it does not disclose pagination behavior, how limits truncate the matrix, or what happens when filters are applied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly written sentences, with the operation stated first, a concrete example, and the key output shape. Every clause earns its place and there is no fluff.

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

Completeness2/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 no output schema and 27% schema coverage, the description is too thin: it omits the required propertyId, date handling, filter behavior, pagination semantics, and does not route the agent among closely related sibling report tools. An agent could call the defaults, but it would not know how to configure the tool correctly for non-default cases.

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?

The description maps the core parameters to concrete examples (landingPage rows, deviceCategory columns, sessions metric), adding meaning to parameters that lack schema descriptions. However, schema coverage is only 27% and the description leaves dates, limits, pagination, and dimensionFilters unexplained, so it only partially compensates.

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 uses a specific verb and resource ('Cross-tab one dimension against another' in GA4) and clarifies the result as a matrix with row totals, so the tool's purpose is unmistakable. It does not explicitly contrast with sibling tools like ga_run_report, but the pivot semantics inherently distinguish it from a flat GA4 report.

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 implies when to use the tool ('give rowDimension, columnDimension and metrics') and positions it as simpler than the raw API, but it never names alternatives or states when not to use it. Sibling tools such as ga_run_report or ga_run_funnel_report are not mentioned, so the selection guidance is left to inference.

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