Skip to main content
Glama
artgas1

yandex-metrika-mcp-server

Получение данных по времени

metrika_stat_bytime
Read-onlyIdempotent

Get Yandex Metrika statistics split by time periods (day, week, month) to build charts and track changes in metrics across a selected date range.

Instructions

Получение данных по времени. Позволяет получить данные с разбивкой по времени (например, по дням, неделям, месяцам). Используйте данный тип запроса для построения графиков и отслеживания динамики. [GET https://api-metrika.yandex.net/stat/v1/data/bytime] Документация: https://yandex.ru/dev/metrika/ru/stat/openapi/bytime.md

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.3.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already cover readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds the GET endpoint and the time-series behavior, but it does not describe response format, pagination, authentication needs, or limitations. It is consistent with the annotations and adds modest behavioral context beyond them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact but somewhat redundant: the first sentence restates the title, and the second partially repeats it before adding the useful example breakdown. The endpoint URL and documentation link are valuable, though a merged, front-loaded sentence would be tighter.

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

Completeness3/5

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

For a complex 22-parameter API with no output schema, the description gives the core purpose, endpoint, and documentation link, but does not describe what the returned data looks like or how the time grouping maps to API output. It is adequate for tool selection but not fully self-contained for a correct call without referring to docs.

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 description coverage is 100%, so the parameters are already well documented. The description adds conceptual context for the grouping behavior ('by days, weeks, months'), which relates to the group parameter, but it does not systematically explain parameters beyond what the schema already offers.

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 resource (Yandex Metrika statistics) and the key behavior: retrieving data with a time breakdown (by days, weeks, months). It identifies the query type for charts and dynamics tracking, though it does not explicitly differentiate itself from sibling tools like metrika_stat_data.

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 explicitly says to use this query type for building charts and tracking dynamics, which gives a clear when-to-use context. It does not mention when not to use it or name alternative tools, so it stops short of full routing guidance.

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