Skip to main content
Glama
ga4-gsc-mcp

ga4-gsc-mcp

by kkvlabs

Run a GA4 report

run_ga4_report
Read-onlyIdempotent

Runs raw GA4 Data API reports with custom dimensions, metrics, filters, and sorting to answer analytics questions other tools do not cover.

Instructions

Any GA4 question the other tools do not cover: a raw Google Analytics Data API runReport with your own dimensions, metrics, filters and order (API names, e.g. sessionDefaultChannelGroup, sessions).

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

Input Schema

NameRequiredDescriptionDefault
siteNoSite as a domain or Search Console URL, e.g. "example.com" or "sc-domain:example.com". Optional when the credentials see one site.
limitNoRows to return, default 100, max 10000.
formatNojson (default) or csv for a table you can paste into a spreadsheet.
offsetNoRow offset for paging.
periodNoNamed date range ending on the last settled day. Default last_28_days.
metricsYesGA4 metric API names, e.g. sessions, totalUsers, keyEvents, engagementRate.
end_dateNoEnd date YYYY-MM-DD. Defaults to the last settled day (Search Console lags 2 to 3 days).
order_byNoSort field. Metrics sort descending by default.
dimensionsNoGA4 dimension API names, e.g. date, country, pagePath, sessionSourceMedium.
start_dateNoStart date YYYY-MM-DD. Overrides period.
ga4_propertyNoGA4 property ID (numbers only). Optional: found from the site's web stream when left out.
metric_filterNoGA4 FilterExpression JSON on metrics.
dimension_filterNoGA4 FilterExpression JSON, e.g. {"filter":{"fieldName":"country","stringFilter":{"value":"India"}}}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds the meaningful cue that this is a raw API passthrough whose field names must be GA4 API identifiers, but it says nothing about quota/rate-limit failures, invalid-field errors, or how large result sets are paged.

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?

A single sentence that front-loads the routing rule and then specifies the mechanism. No filler, no restatement of the title, and the API-name caveat is parenthetical rather than buried.

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 13-parameter tool with nested FilterExpression objects and no output schema, the definition does not describe what a result looks like (row shape, metric/dimension pairing, how filters compose). The schema compensates for most parameter detail, but the raw-report output contract and paging workflow are left entirely to the agent.

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% and each parameter already carries a description, so the baseline is 3. The description adds a little real value by warning that dimension and metric values are API names, with examples (sessionDefaultChannelGroup, sessions), which steers the agent away from human-readable labels — though the schema repeats much of this.

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?

States a specific verb and resource (raw Google Analytics Data API runReport) with the exact caller-supplied inputs (dimensions, metrics, filters, order). The opening clause 'Any GA4 question the other tools do not cover' positions it clearly against the curated siblings like ga4_funnel or run_ga4_pivot_report.

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?

Gives an explicit selection rule: use this for GA4 questions the other tools do not cover, i.e. a general fallback for arbitrary queries. It falls short of 5 because it never names which siblings to prefer for the common cases (pivot, realtime, batch), so the agent must infer the boundary from sibling names alone.

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