Skip to main content
Glama
artgas1

yandex-metrika-mcp-server

Сравнение - drill down

metrika_stat_comparison_drilldown
Read-onlyIdempotent

Compare segments with drill-down details, retrieving metrics for each grouping branch for segment A and B, with separate date ranges and filters.

Instructions

Сравнение - drill down. С помощью данного метода можно комбинировать методы Drill down и Сравнение сегментов. Таким образом позволяет получить данные по ветвям дерева для сравнения сегментов. Для каждого значения группировки API возвращает два набора метрик. Например, для сегмента A и сегмента B. Для каждого сегмента можно задать разные диапазоны дат и фильтры сегментации. [GET https://api-metrika.yandex.net/stat/v1/data/comparison/drilldown] Документация: https://yandex.ru/dev/metrika/ru/stat/openapi/comparison_drilldown.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesИдентификаторы счетчиков, через запятую. Пример: 44147844,2215573.
langNoЯзык.
sortNoСписок группировок и метрик, разделенных запятой, по которым осуществляется сортировка. По умолчанию сортировка производится по убыванию (указан знак `-` перед группировкой или метрикой). Чтобы отсортировать данные по возрастанию, удалите знак `-`.
date1NoДата начала периода выборки в формате YYYY-MM-DD. Также используйте значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: 6daysAgo.
date2NoДата окончания периода выборки в формате YYYY-MM-DD. Также используйте значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: today.
limitNoКоличество элементов на странице выдачи. По умолчанию: 100.
offsetNoИндекс первой строки выборки, начиная с 1. По умолчанию: 1.
presetNo[Шаблон отчета](https://yandex.ru/dev/metrika/ru/stat/presets.md). Пример: sources_summary.
prettyNoЗадает форматирование результата. Чтобы использовать форматирование, укажите значение `true`. По умолчанию: false.
date1_aNoДата начала периода выборки для сегмента A в формате YYYY-MM-DD. Также поддерживаются значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: 6daysAgo.
date1_bNoДата начала периода выборки для сегмента B в формате YYYY-MM-DD. Также поддерживаются значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: 6daysAgo.
date2_aNoДата окончания периода выборки для сегмента A в формате YYYY-MM-DD. Также поддерживаются значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: today.
date2_bNoДата окончания периода выборки для сегмента B в формате YYYY-MM-DD. Также поддерживаются значения: `today`, `yesterday`, `ndaysAgo`. По умолчанию: today.
filtersNoФильтр [сегментации](https://yandex.ru/dev/metrika/ru/stat/segmentation.md).
metricsYesСписок метрик, разделенных запятой. Пример: ym:s:pageviews.
accuracyNoРазмер выборки, используемой для отчета. Позволяет управлять [семплированием](https://yandex.ru/dev/metrika/ru/stat/sampling.md) (количеством визитов, использованных при расчете итогового значения).
callbackNoФункция обратного вызова, которая обрабатывает ответ API.
timezoneNoЧасовой пояс в формате ±hh:mm в диапазоне [-23:59; +23:59] (знак плюса нужно передавать как `%2B`), Пример: +03:00.
filters_aNoФильтр сегментации для сегмента A.
filters_bNoФильтр сегментации для сегмента A.
parent_idNoВыбор строки для дальнейшего развертывания. Состоит из json-списка ключей.
dimensionsNoСписок группировок, разделенных запятой. Пример: ym:s:trafficSource.
include_undefinedNoВключает в ответ строки, для которых значения группировок не определены. Влияет только на первую группировку. По умолчанию выключено.
proposed_accuracyNoЕсли параметр выставлен в `true`, API имеет право автоматически увеличивать accuracy до рекомендованного значения.Когда идет запрос в маленькую таблицу с очень маленьким семплингом, параметр поможет получить осмысленные результаты.
human_traffic_onlyNoРезать роботов. По умолчанию true. Добавляет к filters: ym:s:isRobot=='no'. Не применяется к метрикам и измерениям ym:ad: и ym:ev: — Метрика отвечает на них 400.
direct_client_loginsNoЛогины клиентов Яндекс Директа, через запятую. Могут использоваться для формирования отчета [Директ-расходы](https://yandex.ru/dev/metrika/ru/stat/direct-clicks.md). Пример: login1,login2.
only_expandable_undefinedNoУдалять из результата нераскрывающиеся неопределённые значения. Имеет смысл только в случае include_undefined=true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.3.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive hints. The description adds behavioral context: for each grouping value the API returns two sets of metrics, and per-segment date ranges and filters can be set. This goes beyond annotations and helps the agent understand the response shape and configurability.

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 reasonably compact, starting with the core purpose and then elaborating with a concrete example of return structure. It includes the endpoint URL and documentation link but is not overly verbose. The structure is clear and front-loaded.

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 27 parameters and no output schema, the description is insufficient. It omits crucial details about how the drilldown mechanism works (e.g., parent_id, tree traversal), pagination, error handling, and how the two metric sets are structured in the response. The documentation link is not accessible to the agent, so the description alone does not provide enough guidance for correct usage.

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?

Schema coverage is 100%, so all 27 parameters have description in the input schema. The tool description adds minimal parameter-specific insight, only mentioning per-segment filters and dates in general terms. It does not compensate beyond the schema, so the baseline of 3 applies.

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 clearly states this method combines Drill down and Comparison segment methods, and explicitly explains it returns two sets of metrics per grouping for comparing segments. It names the endpoint and distinguishes itself from the sibling tools by describing the combination behavior.

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?

The description says 'using this method you can combine Drill down and Comparison' which gives clear context for when to use it relative to the separate tools. However, it does not explicitly state when NOT to use it or mention alternatives, so it lacks explicit exclusions.

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