Skip to main content
Glama
leonardosepulvedat

MCP Google Analytics Server

ga_run_pivot_report

Read-onlyIdempotent

Cross-tabulate GA4 metrics with pivot reports using row and column dimensions. Limit dimensions and date ranges to keep output size manageable.

Instructions

Run a pivot table report with row and column dimensions.

⚠️ TOKEN OPTIMIZATION: Pivot reports can be VERY large. Limit dimensions and use small date ranges. Recommended for analysis, not raw data extraction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pivotsYesPivot specifications with fieldNames
metricsYes
dateRangesYes
dimensionsNo
propertyIdNoGA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv1.3.1
    • addedInput schema / properties / propertyId
      Added value: +{
      +  "description": "GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts \"123456789\" or \"properties/123456789\". Use ga_get_account_summaries to discover IDs.",
      +  "type": "string"
      +}
  2. Changed14 schema fields changedv1.1.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / dateRanges / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / dateRanges / items / properties / endDate / description
      Added value: +"End date (YYYY-MM-DD or \"yesterday\", \"today\", \"7daysAgo\")"
    • addedInput schema / properties / dateRanges / items / properties / name
      Added value: +{
      +  "description": "Optional name for the date range",
      +  "type": "string"
      +}
    • addedInput schema / properties / dateRanges / items / properties / startDate / description
      Added value: +"Start date (YYYY-MM-DD or \"yesterday\", \"today\", \"7daysAgo\")"
    • addedInput schema / properties / dimensions / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / metrics / items / $ref
      Added value: +"#/properties/dimensions/items"
    • removedInput schema / properties / metrics / items / properties
      Removed value: -{
      -  "name": {
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / metrics / items / required
      Removed value: -[
      -  "name"
      -]
    • removedInput schema / properties / metrics / items / type
      Removed value: -"object"
    • addedInput schema / properties / pivots / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / pivots / items / properties / limit / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / pivots / items / properties / limit / type
      Previous value: -"number"New value: +"integer"
  3. First observedv1.0.1

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already cover read-only and idempotent behavior. The description adds useful behavioral context beyond the schema by warning that pivot reports can be VERY large and that token usage should be managed by limiting dimensions and date ranges. This is important operational guidance an agent would not get from annotations alone.

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?

The description is only two short sentences, front-loaded with the core purpose and followed by a high-value warning. Every sentence earns its place, and there is no redundant filler.

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?

The tool has 5 parameters, no output schema, and no description of return values or pivot structure, making this incomplete for confident invocation. It does not clarify the relationship between the 'dimensions' and 'pivots' parameters, nor does it explain when to use this tool versus ga_run_report. The token-optimization warning is valuable, but it does not fill the structural gaps.

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

Parameters2/5

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

Schema description coverage is only 40%, and the description does not compensate by clarifying the missing parameters. It gives high-level advice to limit dimensions and date ranges, but does not explain how pivots map to row/column dimensions, what metrics should contain, or how fieldNames in pivots work. The description adds strategic guidance but not enough parameter-level meaning.

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 clearly states the verb and resource: 'Run a pivot table report with row and column dimensions.' This distinguishes it from ga_run_report and ga_run_realtime_report at a basic level, though it does not explicitly name those siblings or explain the exact difference beyond the pivot-table concept.

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?

The description gives clear context: pivot reports are for analysis, not raw data extraction, and should use limited dimensions and small date ranges. It does not explicitly name alternative tools like ga_run_report for raw extraction, but the guidance is actionable enough for an agent to select the right use case.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leonardosepulvedat/mcp-google-analytics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server