Skip to main content
Glama

Traffic from AI assistants (GA4)

get_ai_traffic
Read-onlyIdempotent

Referral sessions from AI assistants (chatgpt.com, perplexity.ai, gemini, copilot, claude…) according to GA4 (dimension ai_source): per source (sessions, activeUsers, engagedSessions, keyEvents) for the period and the comparison, totals and daily series. site also accepts "all" for the whole account. A property without GA4 returns the error no_data with the panel URL where GA4 is connected (site="all" returns hasGa4=false and a setup note instead). Limitation: Search Console does not separate clicks from AI Overviews / AI Mode; only referral traffic is measurable. / Sessões vindas de IAs segundo o GA4.

Input Schema

NameRequiredDescriptionDefault
daysNoWindow length in days (default 28). Ignored when startDate and endDate are both given. / Janela em dias.
siteYesProperty (as in other tools) or "all" for the whole account.
compareNoComparison: previous (default) = same-length window immediately before; year = same dates one year earlier; none. / Comparação.
endDateNoEnd yyyy-mm-dd. Default: last synced date of the property (Search Console lags ~3 days; never "today"). Every response states the period used. / Fim; padrão = última data sincronizada.
startDateNoStart yyyy-mm-dd. Default: endDate − (days − 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds substantive behavior beyond that: the no_data error for properties without GA4, the setup-note/hasGa4=false behavior for site="all", and the shape of the return (per-source metrics, totals, daily series). No auth, rate-limit, or pagination notes, but for a read-only analytics tool that's a minor gap.

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?

Front-loaded with the purpose, then data shape, then error behavior, then limitation — a logical ordering with little waste. Slightly dense and the trailing Portuguese echo adds no information for an agent reading the English, but no sentence is truly superfluous.

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?

With no output schema, the description carries the full burden of explaining return values, and it does: per-source metrics, totals, daily series, plus the two failure/setup paths. An agent can call this and interpret the response without opening anything else.

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%, so the schema already documents days, site, compare, startDate and endDate. The description reinforces site="all" for the whole account and mentions the comparison window, but adds little syntax or edge-case meaning the schema doesn't already carry; baseline 3 applies when the schema does the heavy lifting.

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?

States a specific resource (referral sessions from AI assistants with enumerated sources) and names the exact data source and dimension (GA4, ai_source), plus the metrics returned. It implicitly separates itself from the Search Console AI-impressions sibling via the limitation note, but never names that sibling (get_genai_impressions) directly, so an agent must infer the split.

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 limitation sentence gives a clear when-not-to-use signal ('Search Console does not separate clicks from AI Overviews / AI Mode; only referral traffic is measurable'), which is real guidance. However, it stops short of pointing at the alternative tool for AI Overview impressions, leaving the routing to inference.

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.