Skip to main content
Glama

GSCPAP - Google Search Console, GA4, PageSpeed Insights & live SERPs MCP

GA4 custom report

ga4_report
Read-only

Any GA4 report: your own dimensions, metrics, filters and order.

A read-only wrapper over the Data API's runReport, the GA4 counterpart of search_analytics_query. Use it when the fixed ga4_* tools do not have the slice you need: landing page x source/medium x country, one country or device only, custom dimensions, item-level ecommerce. Field names are GA4 API names (sessionSourceMedium, landingPagePlusQueryString, itemName, itemRevenue, customEvent:plan); call ga4_metadata to find the property's own, custom definitions included. Google rejects an unknown name or a pair it cannot combine, and the error says which.

Do not add rows up for users: GA4 deduplicates users across rows, so the row sum overcounts. totals is Google's own total for the whole report, filters applied, and is the figure to quote.

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": {
      "property_id": "<property_id>",
      "metrics": "<metrics>"
    },
    "name": "ga4_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNolookback window (1-365), default 28
limitNorows to return (1-10000), default 100
offsetNorows to skip, for the next page
metricsYes1 to 10 metric API names, e.g. ["sessions", "keyEvents", "totalRevenue"]
end_dateNooptional YYYY-MM-DD. Alone, the window is `days` days ending on this date
order_byNoa metric or dimension in the report. Default: the first metric
dimensionsNo0 to 9 dimension API names, e.g. ["landingPage", "sessionSourceMedium", "country"]. Omit for totals only
order_descNodescending (default) or ascending
start_dateNooptional YYYY-MM-DD. With it the window is start_date to end_date (or today), and days is ignored
property_idYesGA4 property id (numeric or "properties/XYZ")
metric_filterNothe same shape, on metrics, applied after aggregation, e.g. {"filter": {"fieldName": "sessions", "numericFilter": {"operation": "GREATER_THAN", "value": {"int64Value": "10"}}}}
include_totalsNoreturn Google's total row as `totals` (default True)
dimension_filterNoa GA4 FilterExpression in the Data API's JSON shape, on dimensions. One filter: {"filter": {"fieldName": "country", "stringFilter": {"value": "United States"}}} Values match what GA4 reports (it says "Türkiye", not "Turkey"), so break down by the field first when unsure. stringFilter takes matchType EXACT (default), BEGINS_WITH, ENDS_WITH, CONTAINS, FULL_REGEXP or PARTIAL_REGEXP and caseSensitive; inListFilter takes {"values": [...]}. Combine with andGroup / orGroup ({"expressions": [...]}) or notExpression. A list of filters means all must match

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare read-only, open-world and non-destructive behavior, so the baseline transparency bar is lower. The description adds substantial context beyond annotations: field validation failures come back from Google with the offending name or pair, users are deduplicated across rows, and totals should be quoted rather than summed. These are exactly the behavioral traits that prevent misuse.

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 front-loaded with the core purpose, then moves into when-to-use guidance, field naming, and reporting caveats. Every paragraph earns its place for a complex custom-report tool, and there is no filler or repeated schema detail.

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

Completeness5/5

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

Given a 13-parameter custom-report tool with an output schema and read-only annotations, the description is complete enough for correct invocation. It covers routing, field-name discovery, rejection behavior, the user-deduplication pitfall, and how to treat totals. No critical agent-facing context is missing.

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 coverage is 100%, so the schema already documents all 13 parameters and their formats. The description adds meaningful semantic guidance beyond the schema by explaining that field names must be GA4 API names, giving real API-name examples, and directing the agent to ga4_metadata for property-specific and custom definitions. It does not re-explain every parameter, but it adds value where name validity matters most.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: run any custom GA4 report with chosen dimensions, metrics, filters and order. It distinguishes this from the fixed ga4_* tools and explicitly identifies the underlying Data API runReport and its GSC counterpart. An agent can tell exactly what this tool is for without opening the schema.

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

Usage Guidelines5/5

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

It gives explicit routing guidance: use this when the fixed ga4_* tools do not cover the needed slice, with concrete examples such as landing page by source/medium by country, device-only reports, custom dimensions and item-level ecommerce. It also names ga4_metadata for discovering valid field names. The alternatives and triggering conditions are clear.

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.