Skip to main content
Glama
BoxLab-Ltd

yandex-metrica-mcp

by BoxLab-Ltd

Compare Metrica segments

run_comparison
Read-only

Compare two segments or periods in Yandex Metrica to see metric values for each plus the absolute and percentage delta, using the first as baseline.

Instructions

Compare two segments/periods (A vs B) for the same metrics and dimensions (/stat/v1/data/comparison). Returns per-metric values for A and B plus the absolute and percentage delta, computed server-side: delta = B − A (segment A is the baseline), delta_pct = (B − A) / A × 100. Defaults to last 7 days (B) vs the prior 7 days (A), so a positive delta means growth. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort fields; prefix a field with "-" for descending, e.g. ["-ym:s:visits"].
limitNoRows per page (max 100000). Defaults to a small value to protect context.
date1ANoSegment A start date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo).
date1BNoSegment B start date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo).
date2ANoSegment A end date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo).
date2BNoSegment B end date as YYYY-MM-DD or relative (today, yesterday, NdaysAgo).
offsetNo1-based index of the first row to return, for pagination. Default 1.
presetNoNamed Metrica report preset (advanced); can substitute for metrics/dimensions.
metricsYesMetric ids, e.g. ["ym:s:visits","ym:s:users"]. Max 20. Discover valid ids with get_metadata. Do not mix ym:s: (visits) and ym:pv: (hits) namespaces in one call.
accuracyNoSampling accuracy: low | medium | high | full, or a 0..1 share. Use "full" for exact data.
filtersANoFilter expression for segment A.
filtersBNoFilter expression for segment B.
timezoneNoTimezone offset for the report as ±hh:mm, e.g. "+03:00". Defaults to the counter timezone.
counterIdNoYandex Metrica counter id. Optional if YANDEX_METRIKA_COUNTER_ID is configured.
dimensionsNoDimension ids to group by, e.g. ["ym:s:lastsignTrafficSource"]. Max 10. Do not mix ym:s: and ym:pv: namespaces.
fullResponseNoIf true, include all dimension sub-fields (id, icons, …). Default false: only the dimension name and metric values are returned, to save context.
includeUndefinedNoInclude rows where the first dimension value is undefined ("Not set"). Default false.
Behavior5/5

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

Annotations already declare readOnlyHint=true, but the description adds meaningful behavioral details: the delta is computed server-side with the exact formula (delta = B − A, delta_pct = (B − A) / A × 100), and a positive delta means growth. This goes beyond the annotation's safety profile.

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?

The description is compact and front-loaded: it states the core purpose first, then explains the delta calculation and defaults, and ends with 'Read-only.' Every sentence contributes useful information with no redundancy or fluff.

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?

There is no output schema, but the description explains the return structure: per-metric values for A and B plus absolute and percentage delta. It also covers defaults, read-only nature, and the delta computation. Given the richness of the input schema, this is sufficient for an agent to invoke the tool 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 coverage is 100%, so the baseline is 3. The description adds extra meaning by explaining the default date range (last 7 days vs prior 7 days), which is not in the schema's parameter descriptions. This helps the agent understand the date parameters without needing to infer defaults.

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?

The description opens with a specific verb and resource: 'Compare two segments/periods (A vs B) for the same metrics and dimensions', clearly distinguishing it from sibling tools like run_report or run_timeseries. It also specifies the endpoint path and the output (per-metric values and deltas).

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?

It clearly states the intended use case—comparing two segments/periods—and explains the default period behavior ('last 7 days (B) vs the prior 7 days (A)'). However, it does not explicitly mention when not to use it or name alternative tools, so it falls short of a 5.

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/BoxLab-Ltd/yandex-metrica-mcp'

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