Skip to main content
Glama

Get Google Analytics (GA4) data

get_analytics
Read-only

GA4 traffic of the account's connected property: sessions, users, page views, daily trend, top sources and pages, plus the sessions and revenue AI assistants (ChatGPT, Perplexity, Gemini, Claude, Copilot...) send. For the AI part only, prefer get_ai_referrals. Not available with a per-brand key (GA4 is account-wide).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_analytics"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoPeriod in days: 7, 28 (default) or 90.
brandNoBrand id, name or domain (from list_brands). Optional when the account has a single brand.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered; the description adds behavioral context the annotations cannot: the data is account-wide (not per-brand) and the tool is unusable with a per-brand key. It does not mention data freshness, caching, or whether the GA4 property must be connected first, which keeps it from a 5.

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

Conciseness4/5

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

Three sentences, front-loaded with what the tool returns and followed by the routing and availability caveats. The parenthetical vendor list ('ChatGPT, Perplexity, Gemini, Claude, Copilot...') is illustrative but slightly less essential than the rest, leaving minor trim available.

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

Completeness4/5

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

With no output schema, the description correctly carries the burden of describing the returned metrics in detail, which it does. It stops short of covering connection prerequisites or whether results reflect the full property versus a subset. This is close to complete for an annotated read-only analytics fetch.

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?

Schema description coverage is 100% and both parameters carry descriptions (days with its 7/28/90 enum and default, brand with its fallback behavior), so the schema does the heavy lifting. The description adds no parameter-level meaning beyond what is in the schema, so the baseline 3 applies.

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 ('GA4 traffic of the account's connected property') and then enumerates the concrete metrics returned: sessions, users, page views, daily trend, top sources/pages, and AI-referral sessions/revenue. It also explicitly distinguishes itself from get_ai_referrals for the narrower AI-only case, so an agent can separate it from its nearest sibling without opening either 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?

Names an alternative tool ('For the AI part only, prefer get_ai_referrals') with the exact condition that selects it, and adds a negative precondition ('Not available with a per-brand key') that would otherwise cause a failed call. Both the when-to-use-elsewhere and when-not-to-use-this are stated explicitly rather than implied.

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.