Skip to main content
Glama

Site Insights by KKV Labs

Traffic sources

traffic_sources
Read-onlyIdempotent

Every GA4 traffic source for one site, grouped by channel, source and medium, source, medium or campaign, with sessions, share, users, engagement, key events and change against a comparison period. Ranked by sessions, paged.

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
rawNotrue returns Google's response exactly as Google sent it, unchanged.
siteNoThe site's domain (example.com) or its label. Optional when the account has exactly one site switched on. An unknown name returns an error that lists the switched on sites.
offsetNoRow to start from, for the next page. Default 0.
periodNoDate range. Default last_28_days. Named ranges end when the data is complete.
compareNoWhat to compare with. Default previous_period (same length, right before).
end_dateNoCustom end date YYYY-MM-DD.
group_byNo
page_sizeNoRows per page, default 1000, max 5000. Every row is available through paging.
start_dateNoCustom start date YYYY-MM-DD. Overrides period.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds behavior the annotations do not: results are ranked by sessions and paged, and each row carries share, users, engagement, key events, and change against a comparison period. It does not state whether paging is consistent or total row counts.

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 sentence that front-loads the resource and then lists groupings, metrics, and ordering; almost nothing is wasted. The phrase 'grouped by channel, source and medium, source, medium or campaign' is slightly tangled because it inlines the enum values, which costs a moment of parsing.

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 nine parameters and no output schema, the description carries the burden of describing what comes back, and it does name the metric columns, ranking, and paging. It omits the shape of the response (rows, totals, comparison deltas per row) and any note on site resolution when multiple sites exist, leaving gaps for a reporting tool of this complexity.

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 89%, so the baseline is already 3, and the description earns more by spelling out the grouping dimension choices (channel, source_medium, source, medium, campaign) that the schema enumerates without any description on group_by, and by naming the metrics that the period and compare parameters act on. It still does not clarify how start_date/end_date interact 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?

States a specific resource (GA4 traffic sources for one site), the available groupings, the metrics returned, and the ordering (ranked by sessions, paged). That is enough to distinguish it from a pages or queries report, and it echoes the title while adding real substance. It stops short of naming a sibling it should not be confused with, so no 5.

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

Usage Guidelines2/5

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

The description says what the report contains but never says when to reach for it rather than a sibling such as ai_traffic or traffic_drops, nor any prerequisite or exclusion. An agent must infer from the payload alone that this is the channel/source breakdown report; there is no explicit routing guidance.

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.

Resources