Skip to main content
Glama

Get AI assistant referral traffic

get_ai_referral_traffic
Read-only

Measure real visits the site gets from AI assistants — ChatGPT, Perplexity, Gemini, Copilot, Claude, DeepSeek, Grok and others — from Google Analytics: sessions, engagement, key events (conversions) and revenue per assistant, the share of all traffic AI now drives, and optionally which landing pages they cite. Combines GA4's built-in AI Assistant channel with referrer matching, so it also covers assistants and history the built-in channel misses. Use it to prove AI-search visibility pays off, track its growth with compareTo, and pick pages to optimize for AI answers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoExplicit end (YYYY-MM-DD, property time zone). Use with startDate.
rowLimitNoRows to return (default 100).
compareToNoAdd a comparison window. Each metric then gets <metric>_previous and <metric>_change (relative, -0.25 = down 25%). Use previous_period to explain a traffic drop, previous_year to strip out seasonality.
dateRangeNoConvenience window ending yesterday (default last_28_days). Ignored if startDate+endDate are given.
projectIdYesRequired. The HarborRank project ID to scope this call to. Get one from list_projects.
startDateNoExplicit start (YYYY-MM-DD, property time zone). Use with endDate.
byLandingPageNoAlso split by landing page, to see which pages AI assistants send people to.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
metaNo
rowsNo
reasonNo
aiShareNo
endDateNo
startDateNo
aiSessionsNo
connectUrlNo
propertyIdNo
allSessionsNo
dataQualityNo
propertyNameNo
compareEndDateNo
compareStartDateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish readOnly/openWorld/non-destructive safety, so the description only needs to add context. It does, usefully: it discloses the data provenance (GA4's AI Assistant channel plus referrer matching) and notes it covers assistants and history the built-in channel misses. It omits auth/rate-limit behavior, but the sourcing detail is genuine added value.

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?

A single dense paragraph that is front-loaded with the core purpose and then layers scope, sourcing, and use cases. Nearly every clause earns its place, though the provider list and closing tips make it longer than strictly necessary.

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 an output schema present, the description need not explain return values, and it supplies scope, data source, differentiating coverage, and usage intent. An agent has everything needed to select and call this tool correctly, including the required projectId pointer via list_projects.

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 baseline is 3. The description references compareTo and the landing-page split, and clarifies what metrics surface (revenue per assistant, AI's share of all traffic), but the parameter-specific semantics (formats, enums, defaults) already live in the schema, so this adds only marginal meaning.

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 (measure) and resource (AI assistant referral traffic) with named scope: sessions, engagement, key events, revenue per assistant. It is unmistakably distinct from broad siblings like get_analytics_report or get_landing_page_performance because it names the AI-assistant channel and its providers.

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 concrete usage contexts — prove AI-search visibility pays off, track growth with compareTo, and pick pages to optimize — which tells the agent when this tool is the right pick. It stops short of naming an alternative tool or an explicit when-not condition against get_analytics_report.

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.