Skip to main content
Glama
Lermont

yadirect-mcp

by Lermont

direct_regions

Read-only

Resolve Yandex Direct region names into geo IDs and verify region codes before use, preventing silent mis-targeting in reports and campaigns.

Instructions

Коды регионов Директа по названию и обратная проверка готовых кодов.

Вызывать всегда, когда в geo_ids (direct_wordstat) или RegionIds (direct_campaign_setup) уходит регион: Директ коды НЕ проверяет. Неверный код не вызовет ошибку — он молча даст данные и показы не по тому региону, и заметно это станет только по статистике.

query: часть названия, например "Москва", "Ростов", "Татарстан". Регистр и «ё» не важны. Совпадения возвращаются с путём до корня (path), потому что названия неуникальны: «Москва» — это и город 213, и «Москва и область» 1. ids: коды для обратной проверки. Вернёт названия, а отсутствующие в справочнике коды — отдельным списком unknown_ids. client_login: нужен только агентскому токену — Директ требует заголовок Client-Login на клиентских методах. Подойдёт любой логин из direct_list_clients. limit: сколько совпадений вернуть, 1–200.

Нужен хотя бы один из query / ids: справочник целиком тул не отдаёт. Загружается он один раз на процесс, повторные вызовы баллов не тратят.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsNo
limitNo
queryNo
client_loginNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Even with readOnlyHint=true, the description adds substantial behavioral detail: Direct does not check region codes so invalid codes cause silent wrong-region data, matches include a path to root because names are non-unique, invalid ids are returned as unknown_ids, the full directory is not returned, and the reference is loaded once per process so repeated calls do not consume points. This goes far beyond the annotation and fully informs the agent of expected edge cases.

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 dense but well organized: a short purpose plus a critical warning up front, then per-parameter explanations in a consistent format, and a final constraint note. Every sentence adds operational value, and the structure makes it easy to scan.

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?

The description is complete for an agent to invoke the tool correctly: it covers when to call, why it matters, all parameters and their constraints, expected special return behavior (unknown_ids, path), and a prerequisite about agency tokens. Since an output schema exists, return values beyond what is described do not need to be spelled out.

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 description coverage is 0%, but the description compensates by thoroughly explaining each parameter: query with examples and case/ё-insensitivity, ids with the unknown_ids output, client_login with a clear condition and source, and limit with a 1–200 range. It also clarifies the logical constraint that at least one of query/ids is required, which the schema does not convey.

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 clear statement of what the tool does: returns Direct region codes by name and reverses-validates existing codes. It is unambiguous and distinct from all sibling tools, which are about clients, campaigns, wordstat, ads, and reports, none of which provide region reference lookups.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'Вызывать всегда, когда в geo_ids (direct_wordstat) или RegionIds (direct_campaign_setup) уходит регион'. It also explains why this is critical (Direct does not validate codes and silently returns wrong-region data), gives the requirement that at least one of query/ids is needed, and clarifies that client_login is only required for agency tokens and can be taken from direct_list_clients.

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/Lermont/yamcp'

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