Skip to main content
Glama
Rezlazy

yandex-metrika-mcp

by Rezlazy

stat_comparison

Compare Yandex Metrika segments A and B with separate date ranges and filters to identify differences in metrics.

Instructions

Yandex Metrika Reports API. Docs: https://yandex.ru/dev/metrika/ru/stat/ Segment comparison table — GET /stat/v1/data/comparison. Compare segments A and B with separate date ranges and filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesCounter IDs, comma-separated (e.g. 44147844 or 44147844,2215573)
langNoResponse language
sortNoSort by dimensions/metrics comma-separated. Prefix with - for descending
date1NoPeriod start: YYYY-MM-DD, today, yesterday, or ndaysAgo (default: 6daysAgo)
date2NoPeriod end: YYYY-MM-DD, today, yesterday, or ndaysAgo (default: today)
limitNoPage size, max 100000 (default: 100)
formatNoResponse format: json (default) or csv
offsetNoFirst row index, starting from 1 (default: 1)
presetNoReport preset name. See https://yandex.ru/dev/metrika/ru/stat/presets.md
date1_aNoSegment A period start: YYYY-MM-DD, today, yesterday, ndaysAgo (default: 6daysAgo)
date1_bNoSegment B period start: YYYY-MM-DD, today, yesterday, ndaysAgo (default: 6daysAgo)
date2_aNoSegment A period end: YYYY-MM-DD, today, yesterday, ndaysAgo (default: today)
date2_bNoSegment B period end: YYYY-MM-DD, today, yesterday, ndaysAgo (default: today)
filtersNoSegmentation filter expression. See https://yandex.ru/dev/metrika/ru/stat/segmentation.md
metricsYesMetrics comma-separated, max 20. Use ym:s: prefix for visits or ym:pv: for hits. See https://yandex.ru/dev/metrika/ru/stat/attrandmetr/dim_all.md
accuracyNoSample size for report (sampling). See https://yandex.ru/dev/metrika/ru/stat/sampling.md
timezoneNoTimezone as ±hh:mm, e.g. +03:00 (plus sign as %2B in URL)
filters_aNoSegmentation filter for segment A
filters_bNoSegmentation filter for segment B
dimensionsNoDimensions (groupings) comma-separated, max 10. See https://yandex.ru/dev/metrika/ru/stat/attrandmetr/dim_all.md
include_undefinedNoInclude rows with undefined dimension values (first dimension only)
proposed_accuracyNoAllow API to auto-increase accuracy for small samples
direct_client_loginsNoYandex Direct client logins comma-separated (Direct expenses reports)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It mentions a GET request, implying read-only behavior, but does not state that explicitly, nor does it cover authentication, pagination, rate limits, or return format. The description only describes the endpoint and purpose, lacking essential behavioral context for a data retrieval tool.

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?

The description is concise, with two sentences that quickly state the API, endpoint, and purpose. It front-loads the core function and includes a documentation link, avoiding unnecessary detail. It is efficient and well-structured, though it could be more specific about the tool's role among siblings.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 23 parameters, only 2 marked required, and no output schema, the description is too sparse to guide an agent effectively. It does not mention the required ids and metrics parameters, nor does it explain response format, pagination, or any usage caveats. The documentation link helps but the description alone is insufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers all 23 parameters with individual descriptions, so the baseline is 3. The description adds a high-level summary that 'separate date ranges and filters' are involved, which maps to the segment-specific parameters, but it does not explain any parameter semantics beyond what the schema already provides. Thus a 3 is appropriate.

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 description clearly states the tool performs a segment comparison, names the endpoint (GET /stat/v1/data/comparison), and specifies that it compares segments A and B with separate date ranges and filters. This conveys the core function effectively, though it does not explicitly differentiate from the sibling stat_comparison_drilldown, so it falls short of a 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 provides no guidance on when to use this tool versus the many sibling stat_* tools, nor does it mention alternatives or exclusions. It implies usage for segment comparison but does not state conditions, prerequisites, or when to choose another tool like stat_comparison_drilldown. This is a significant gap.

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