Skip to main content
Glama

Get traffic sources

get_traffic_sources
Read-onlyIdempotent

Traffic sources for a site over a date window (max 31 days): visitors, conversion rate, revenue, and conversions per source. Use when the question is about where visitors or revenue come from. Pass utm_campaign (or utm_source, utm_medium) to count one campaign's visits by source.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site_id": "<site_id>"
    },
    "name": "get_traffic_sources"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax rows to return (default 10)
site_idYesSite id from list_sites (UUID)
end_dateNoISO date (YYYY-MM-DD). Defaults to today.
start_dateNoISO date (YYYY-MM-DD). Defaults to 30 days before end_date.
utm_mediumNoOnly visits whose landing URL carried this utm_medium value (exact match)
utm_sourceNoOnly visits whose landing URL carried this utm_source value (exact match)
utm_campaignNoOnly visits whose landing URL carried this utm_campaign value (exact match)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds genuinely useful behavioral context beyond the schema: a hard 31-day maximum window, and that the utm filters narrow counting to a single campaign's visits by source.

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

Conciseness5/5

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

Three sentences, front-loaded with what the tool returns before the when-to-use hint and the campaign-filter tip. No filler, and the 31-day constraint is stated inline where it matters.

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 names the returned metrics and the row-limiting default behavior is covered by the schema. It could say more about ordering of rows (by visitors? revenue?) and how the 31-day limit is enforced, but an agent has enough to call it correctly.

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 description coverage is 100%, so the baseline is 3 and the schema already documents limit, dates, and exact-match utm filters. The description adds real meaning on top by explaining the utm_campaign use case (count one campaign's visits broken down by source) rather than merely repeating the field definition.

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 (traffic sources) and the exact metrics returned (visitors, conversion rate, revenue, conversions) scoped to a site and date window. It is clear what the tool does, though it does not explicitly name the sibling it differs from (e.g. get_analytics_overview or get_top_pages).

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?

"Use when the question is about where visitors or revenue come from" gives a concrete selection criterion for choosing this tool. It stops short of naming an alternative tool or stating when NOT to use it, so it is clear context but not full 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