Skip to main content
Glama
askads

Yandex Metrica MCP

Статистика

get_statistics
Read-onlyIdempotent

Fetch web analytics metrics from Yandex Metrica for a counter, with options for dimensions, metrics, filters, and pagination. Get totals and handle sampling for accurate data.

Instructions

Запрашивает Reporting API Яндекс Метрики (stat/v1/data) по счётчику. ПО УМОЛЧАНИЮ возвращает одну строку, агрегированную за период (без измерений), с visits/users/pageviews/bounceRate/avgVisitDurationSeconds. dimensions разбивает результат на строки (ym:s:date — динамика по дням, ym:s:lastTrafficSource — источники трафика, ym:s:deviceCategory — устройства), metrics задаёт нужные метрики — для конверсий это ym:s:goalreaches / ym:s:goalconversionRate (идентификаторы целей даёт list_goals). В ответе есть totals (итог по ВСЕМ строкам — для вопросов «сколько всего» суммировать не нужно), total_rows и sampled/sample_share (sampled=true означает, что данные приблизительные; для точных цифр нужно сузить период или передать accuracy=full). Если counterId не передан, берётся YANDEX_METRIKA_COUNTER_ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoПоле сортировки; префикс '-' — по убыванию, например -ym:s:visits.
date1NoДата начала: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию 7daysAgo.
date2NoДата конца: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию yesterday.
limitNoМаксимум строк на странице (игнорируется, если задан autoPaginate).
offsetNoСмещение по строкам для постраничной выдачи, отсчёт с 1.
filtersNoВыражение фильтра Метрики, например ym:s:deviceCategory=='mobile'.
metricsNoМетрики, например ym:s:visits, ym:s:users, ym:s:bounceRate, ym:s:goal<id>reaches. По умолчанию — типовой набор.
accuracyNoТочность сэмплирования: 'full' — точный расчёт (медленнее) или доля 0..1. По умолчанию — авторежим API.
maxPagesNoЛимит страниц для autoPaginate. По умолчанию 100.
counterIdNoИдентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID.
dimensionsNoИзмерения для группировки, например ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory. Без них — итог за период.
autoPaginateNoЗабирает все строки, листая страницами максимального для API размера (склеивает data, сохраняет totals). Игнорирует `limit`; ограничен maxPages и лимитами по строкам/байтам (при их достижении выставляет _truncated).
Behavior5/5

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

Annotations already mark it as read-only, idempotent, and non-destructive. The description adds valuable behavioral context: default returns a single aggregated row, totals field should not be summed, sampling with sample/accuracy behavior, autoPaginate semantics, and default counter/env variable fallback. This goes well beyond the structured annotations.

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 a single dense paragraph, but it is logically organized: purpose, default behavior, dimensions/metrics, response semantics, then default counter. Though long, it avoids waste and includes practical notes (autoPaginate, sampling). Loses a point for lack of bullet points or clear sections.

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

Completeness4/5

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

Covers default values (date range, limit, counter), response structure (totals, pagination), and sampling behavior. Missing explicit error cases or output schema, but annotations and parameter descriptions cover most operational needs. It's solid for an API wrapper.

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

Parameters5/5

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

Schema covers all parameters with descriptions, but the tool description adds crucial usage context: date formats and relatives, goal ID format (from get_goals), explanation of autoPaginate, and the meaning of `–` prefix for sort. This materially helps an agent set parameters correctly.

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?

Сообщается конкретный глагол + ресурс:

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

Usage Guidelines3/5

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

The description mentions that goal IDs come from get_goals, implying a relationship, and states defaults for date range and counter ID allocations. However, it does not explicitly state when to prefer this tool over get_analytics, get_visits, or raw_request, nor does it state when not to use it.

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

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