Skip to main content
Glama

Compare traffic sources

analyze_source_quality
Read-onlyIdempotent

Analyze traffic source quality using aggregate source/UTM metrics and attributed conversion events.

Use when the user asks which referrers, campaigns, UTM sources, mediums, or campaigns are working. Returns source-level pageviews, visitors, CTA clicks, form submits, converting visitors, conversion rate, and attribution coverage summary. It does NOT return raw event logs or form submission payloads. A click or form submit counts toward the referrer or UTM value on the page where it happened, and a visitor who both clicks and submits counts once. "(direct)" means no referrer and "(none)" means no UTM tag; attributionCoverageRate is the share of visitors that have one. Data covers the last 3 months and excludes known bots and vulnerability scanners, the same as get_analytics_summary. Dates are YYYY-MM-DD. When the page took orders in the period and the connection has orders:read, the result adds orders: the orders and revenue by the same source dimension (an order records its UTM source, medium, and campaign, and the referring site). Orders hold no visitor id, so they aren't joined to the visitor rows; revenue counts paid orders (cash on delivery once accepted). Dates are days in the workspace's time zone, UTC when the workspace has none set, and startDate and endDate are whole days in the zone used. Pass timeZone, an IANA name such as America/New_York, for days in another zone; it changes only this response, never the workspace's time zone. The result's timeZone field names the zone used, and timeZoneSource says where it came from (argument, workspace, or default). A row for today's date in that zone counts only the hours so far. When timeZonePending is set, the workspace is switching to that zone once its history is recomputed.

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": {
      "siteId": "<siteId>",
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    },
    "name": "analyze_source_quality"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum source rows to return. Defaults to 20, max 100.
siteIdYesThe ID of the page to analyze
endDateYesEnd date (YYYY-MM-DD)
timeZoneNoIANA time zone name for the days in this response, such as America/New_York, Europe/Berlin, or Asia/Tokyo. Leave it out for the workspace's time zone (UTC when none is set). It affects only this response: the workspace's time zone stays as it is, and only the workspace's owner changes it, in the dashboard's Settings. Abbreviations such as EST and offsets such as +09:00 aren't accepted.
dimensionNoSource dimension to group by. Defaults to referrer.referrer
startDateYesStart date (YYYY-MM-DD)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changed
    • changedInput schema / properties / siteId / description
      Previous value: -"The ID of the site to analyze"New value: +"The ID of the page to analyze"
  3. Changed1 schema field changed
    • addedInput schema / properties / timeZone
      Added value: +{
      +  "description": "IANA time zone name for the days in this response, such as America/New_York, Europe/Berlin, or Asia/Tokyo. Leave it out for the workspace's time zone (UTC when none is set). It affects only this response: the workspace's time zone stays as it is, and only the workspace's owner changes it, in the dashboard's Settings. Abbreviations such as EST and offsets such as +09:00 aren't accepted.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world behavior, and the description still adds substantial context beyond them: attribution rules (a click or submit counts toward the source on the page where it happened, a visitor who both clicks and submits counts once), the meaning of '(direct)' and '(none)', what attributionCoverageRate measures, the fixed 3-month window with bot/scanner exclusion, and the conditional orders block with its permission requirement and non-joinable visitor-id caveat. Time-zone semantics, partial-day counting for today, and timeZonePending are also disclosed, so nothing material about behavior is left to guesswork.

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?

It is front-loaded correctly: purpose first, then when-to-use, then return shape, then caveats, then the conditional orders block, then time-zone detail. Given the tool's complexity the length is largely earned, but the time-zone paragraph partly restates the schema's own timeZone description (IANA names, response-only effect), so a little duplication could be trimmed.

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?

For a six-parameter analytics tool with no output schema, the description covers everything an agent needs: the returned measures, the fixed data window and exclusions, attribution counting rules, permission-gated orders output, and date/time-zone resolution including timeZoneSource and timeZonePending. There is no evident gap that would cause a misinvocation.

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 100%, so the schema already documents every parameter including the dimension enum and the timeZone constraints. The description still adds meaning: it explains what each dimension value yields in practice ('(direct)' means no referrer, '(none)' means no UTM tag), clarifies that dates are whole days in the zone used and that timeZone alters only this response, and notes that today's row is partial. Only the limit parameter receives no added semantics, which is minor.

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?

The opening sentence gives a specific verb and resource ('Analyze traffic source quality using aggregate source/UTM metrics and attributed conversion events') and the second names the concrete question it answers (which referrers, campaigns, UTM sources/mediums are working). It also enumerates the returned measures and explicitly excludes raw event logs and form payloads. It stops short of naming the sibling analytics tools (get_analytics_summary, get_analytics_detail) as alternatives, so sibling differentiation is only partial.

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 user asks which referrers, campaigns, UTM sources, mediums, or campaigns are working' gives a clear triggering condition, and the orders caveat states a further condition (page took orders plus orders:read scope). There are no explicit exclusions or named alternatives for the adjacent analytics tools, so the agent must infer the boundary from the described scope.

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.