Skip to main content
Glama
ga4-gsc-mcp

ga4-gsc-mcp

by kkvlabs

Traffic sources

traffic_sources
Read-onlyIdempotent

Identify where visitors come from with GA4 sessions grouped by channel, source/medium, campaign, country, device or landing page, including change, engagement, key events and bot flags.

Instructions

Where do my visitors come from? GA4 sessions by channel, source / medium, source, campaign, country, device or landing page, with change, engagement, key events and bot or spam flags.

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": "traffic_sources"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoGroup by, default channel.
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 25, max 500.
periodNoNamed date range ending on the last settled day. Default last_28_days.
compareNoCompare with the previous period (default), the same dates last year, or none.
end_dateNoEnd date YYYY-MM-DD. Defaults to the last settled day (Search Console lags 2 to 3 days).
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered structurally. The description adds real value by disclosing the returned measures (change, engagement, key events, bot/spam flags) in the absence of an output schema. It does not disclose the data-source constraint (GA4 property resolution, settled-day lag) that materially affects results.

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 front-loaded sentence that leads with the user intent question, then the data source, then the dimensions and measures. No filler. The question framing is slightly informal but earns its place by aiding intent matching.

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?

With 8 optional parameters and no output schema, the description should carry more weight on what a result set looks like and how defaults behave. It does list the measures returned, which is the most important gap filled, but leaves the GA4-vs-Search-Console provenance and the settled-day/compare semantics to the schema.

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 each parameter's meaning, defaults and enum values are already documented in the schema. The description's enumeration of dimensions mirrors the 'by' enum without adding syntax, format or interaction detail (e.g. how start_date overrides period beyond what the schema states).

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?

Names the specific verb/resource pair ('GA4 sessions') and enumerates the seven breakdown dimensions, which lets an agent distinguish this from a query-level tool like search_console_query or top_pages. It stops short of naming a sibling it is not, so the overlap with ai_traffic (a subset of source/channel analysis) must be inferred.

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

Usage Guidelines3/5

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

The framing question 'Where do my visitors come from?' implies the acquisition-analysis use case, and the 'by' dimension list hints at how to pick a grouping. There is no explicit when-to-use versus when-not guidance, and no statement about preferring ai_traffic for AI-referral-specific analysis.

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