Skip to main content
Glama
clamp-sh

Clamp Analytics MCP Server

Official

traffic.compare

Read-only

Compare a metric across two arbitrary periods side-by-side, return values, absolute and percentage delta normalized for different lengths.

Instructions

Compare one metric across two arbitrary periods side-by-side. Returns both period values plus absolute delta and percentage delta. Periods do not need to be the same length — the percentage delta normalizes by ratio so longer/shorter comparisons remain meaningful. Use when the user asks month-over-month, before-vs-after-launch, or "how does this week compare to last".

Examples:

  • "this month vs last month" → metric="visitors", a="2026-04-01:2026-04-25", b="2026-03-01:2026-03-31"

  • "is /pricing converting better since the redesign" → metric="pageviews", a="2026-04-16:2026-04-25", b="2026-04-01:2026-04-15", pathname="/pricing"

Limitations: one metric per call — for multi-metric comparison either call repeatedly or use traffic.overview (which always includes the previous period). Period strings must be a preset ("today", "yesterday", "7d", "30d", "90d") or a YYYY-MM-DD:YYYY-MM-DD range; relative phrases like "last quarter" are not parsed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoTarget project ID (e.g. "proj_abc123"). Required when the credential has access to multiple projects. If omitted and only one project is accessible, that project is used automatically. Call `projects.list` to discover available project IDs.
metricYesThe metric to compare.
aYesFirst period. Use "today", "yesterday", "7d", "30d", "90d", or a custom range "YYYY-MM-DD:YYYY-MM-DD".
bYesSecond period. Same format as `a`.
pathnameNoFilter to a specific page path (e.g. "/pricing", "/blog/my-post"). Must start with /.
utm_sourceNoFilter by UTM source (e.g. "google", "twitter", "newsletter"). Case-sensitive, must match the value in the tracking URL.
utm_mediumNoFilter by UTM medium (e.g. "cpc", "email", "social"). Case-sensitive.
utm_campaignNoFilter by UTM campaign name (e.g. "spring-launch", "product-hunt"). Case-sensitive.
utm_contentNoFilter by UTM content (e.g. "hero-cta", "sidebar-banner"). Case-sensitive.
utm_termNoFilter by UTM term (e.g. "running+shoes"). Case-sensitive.
referrer_hostNoFilter by referrer hostname (e.g. "news.ycombinator.com", "twitter.com", "github.com"). Use this to see what traffic from a specific source did. Must match the value returned by `traffic.breakdown(dimension="referrer_host")` exactly (lowercase, no protocol or path).
countryNoISO 3166-1 alpha-2 country code, uppercase (e.g. "US", "GB", "DE", "NL", "JP"). Filter results to visitors from this country.
regionNoAdministrative region inside a country (e.g. "California", "Bavaria"). Case-sensitive; must match the stored region exactly. Use traffic.breakdown(dimension="region") to discover values.
cityNoCity name (e.g. "San Francisco", "London"). Case-sensitive; must match the stored value. Use traffic.breakdown(dimension="city") to discover values.
device_typeNoDevice category. One of: "desktop", "mobile", "tablet".
browserNoBrowser family (e.g. "Chrome", "Safari", "Firefox"). Use traffic.breakdown(dimension="browser") to discover the exact stored values.
browser_versionNoBrowser version string (e.g. "120.0"). Case-sensitive.
osNoOperating system family (e.g. "macOS", "iOS", "Windows", "Android"). Use traffic.breakdown(dimension="os") to discover stored values.
os_versionNoOS version string (e.g. "14.2"). Case-sensitive.
channelNoTraffic channel. One of: "direct", "organic_search", "organic_social", "paid", "email", "referral".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYes
aYes
bYes
absolute_deltaYes
pct_deltaYes
Behavior4/5

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

Annotations indicate readOnlyHint=true, and description adds that percentage delta normalizes by ratio for unequal period lengths. No contradictions. Adds useful behavioral nuance.

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 concise paragraphs: purpose, examples, limitations. Front-loaded with key information. No extraneous text.

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 output schema present, description need not explain return values. Covers usage, examples, limitations, and parameter formats, fully adequate for a tool with 20 parameters.

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 covers 100% of parameters with descriptions. Description adds value with examples for metric, pathname, and period format, clarifying usage beyond schema.

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?

Description clearly states it compares one metric across two periods, returning period values, delta, and percentage delta. It distinguishes from sibling 'traffic.overview' by noting that overview always includes the previous period.

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

Usage Guidelines5/5

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

Explicitly specifies when to use: month-over-month, before-vs-after-launch, week comparison. Also states limitations (one metric per call, relative phrases not parsed) and suggests alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/clamp-sh/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server