Skip to main content
Glama
leonardosepulvedat

MCP Google Analytics Server

ga_run_report

Read-onlyIdempotent

Run custom Google Analytics 4 reports by specifying dimensions, metrics, and date ranges to retrieve the exact data you need.

Instructions

Run a custom Google Analytics report with dimensions and metrics.

⚠️ TOKEN OPTIMIZATION: Use 'limit' to control result size (default: 10). This tool can consume significant tokens with large datasets.

Common dimensions: date, city, country, deviceCategory, browser, pagePath, eventName Common metrics: activeUsers, sessions, screenPageViews, conversions, totalRevenue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of rows to return (default: 10)
offsetNoNumber of rows to skip (for pagination)
metricsYesMetrics to measure (e.g., [{name: "activeUsers"}])
orderBysNoSorting specification
dateRangesYesDate ranges for the report
dimensionsNoDimensions to group by (e.g., [{name: "date"}])
propertyIdNoGA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs.
metricFilterNoMetric filter expression
dimensionFilterNoDimension filter expression

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. Changed20 schema fields changedv1.1.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / dateRanges / description
      Previous value: -"Date ranges for the report (e.g., [{startDate: \"2024-01-01\", endDate: \"2024-01-31\"}])"New value: +"Date ranges for the report"
    • addedInput schema / properties / dateRanges / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / dimensionFilter
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Dimension filter expression",
      +  "type": "object"
      +}
    • changedInput schema / properties / dimensions / description
      Previous value: -"Dimensions to group by (e.g., [\"date\", \"city\"])"New value: +"Dimensions to group by (e.g., [{name: \"date\"}])"
    • addedInput schema / properties / dimensions / items / additionalProperties
      Added value: +false
    • removedInput schema / properties / limit / default
      Removed value: -10
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of rows to return (default: 10, recommended: 10-50 for token efficiency)"New value: +"Maximum number of rows to return (default: 10)"
    • addedInput schema / properties / limit / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / metricFilter
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Metric filter expression",
      +  "type": "object"
      +}
    • changedInput schema / properties / metrics / description
      Previous value: -"Metrics to measure (e.g., [\"activeUsers\", \"sessions\"])"New value: +"Metrics to measure (e.g., [{name: \"activeUsers\"}])"
    • 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 / offset / minimum
      Added value: +0
    • changedInput schema / properties / offset / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / orderBys / items / additionalProperties
      Added value: +{}
  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?

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds a meaningful behavioral dimension by warning that large datasets can consume significant tokens and recommending the 'limit' parameter. This goes beyond the structured annotations and is practically important for an agent invoking the tool.

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 compact and well-structured. It front-loads the purpose, follows with an important token warning, and then provides useful examples. Every sentence contributes meaningful information without unnecessary fluff.

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?

For a tool with 9 parameters, nested objects, and many related sibling tools, the description is somewhat thin. It does not explain output format, pagination semantics, or when to choose this over related report tools. The schema and annotations compensate for parameter details, but the description alone leaves gaps in selection and expected results.

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 description coverage is 100%, so the baseline is 3. The description adds value by listing common dimensions and metrics, which helps the agent choose valid field names for the 'dimensions' and 'metrics' parameters. It also reinforces the 'limit' default behavior, which is already in the schema but given practical emphasis.

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 core action: 'Run a custom Google Analytics report with dimensions and metrics.' This identifies the verb, resource, and scope. It does not explicitly differentiate from sibling report tools like ga_run_realtime_report, ga_run_pivot_report, or ga_run_funnel_report, so it falls short of a 5.

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?

The description gives no direct guidance on when to use this tool versus alternatives such as realtime, pivot, funnel, or batch report tools. The token-optimization warning implies careful use for large datasets, but it does not state selection criteria or exclusions. Sibling tool names are available in context, but the description itself does not leverage them.

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