Skip to main content
Glama

Ключевые слова

keyness
Read-onlyIdempotent

Identify words that appear significantly more or less often than in a reference corpus or text, revealing how a document's vocabulary differs.

Instructions

Найти ключевые слова текста - слова, которые в нем значимо чаще (или реже), чем в эталоне.

Используйте, чтобы понять, чем лексика текста отличается от обычного языка (эталон по умолчанию - частотный словарь, его нужно скачать командой ruts-mcp download) или от другого текста (reference или reference_path). Слова сравниваются в нижнем регистре и с е вместо ё. Со словарем числа и слова с латиницей отбрасываются, а слово вне словаря получает его наименьшую частоту (freq_reference около 37): имена, термины и опечатки попадают в ключевые слова. Статьи словаря, которые лемматизатор не дает (его, ее, их, во, со), в слова, которые чаще в эталоне, не попадают: в тексте эти формы относятся к другим леммам (он, она, они, в, с).

В результате "n_words" - число слов текста, которые сравниваются с эталоном, "reference" - эталон, "measure" - мера сортировки и как ее читать, "keywords" - слова по убыванию меры: частота в тексте "freq_target" и в эталоне "freq_reference", они же на миллион слов "ipm_target" и "ipm_reference", логарифм правдоподобия "g2" (значимость, со знаком минус - слово чаще в эталоне) с p-значением "p_value", Log Ratio "log_ratio" (размер эффекта; при нулевой частоте в эталоне - оценка с поправкой 0,5, бывает меньше 0) и значение меры "score". p_value не поправлено на число проверенных слов: надежнее p < 0,0001 (g2 от 15,13). Ключ "warnings" - предупреждения: текст не на русском языке, ключевых слов нет.

Input Schema

NameRequiredDescriptionDefault
pathNoАбсолютный путь к текстовому файлу в UTF-8 на машине, где запущен сервер, вместо text: длинный текст не нужно пересылать в аргументе
textNoТекст на русском языке; вместо него можно задать path
top_nNoЧисло ключевых слов в ответе
measureNoМера для сортировки: log_likelihood - значимость различия, log_ratio - во сколько раз слово чащеlog_likelihood
min_freqNoНаименьшая частота слова там, где оно чаще
positiveNoСлова, которые чаще в тексте; false - которые чаще в эталоне
lemmatizeNoСравнивать леммы; с частотным словарем леммы сравниваются всегда
referenceNoТекст-эталон; не задано (и не задан reference_path) - частотный словарь Ляшевской и Шарова (современный русский язык, 92 млн словоупотреблений)
reference_pathNoАбсолютный путь к файлу с текстом-эталоном вместо reference

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses normalization (lowercase, е instead of ё), that numbers and Latin-script tokens are dropped with a dictionary reference, that out-of-vocabulary words receive the dictionary's minimum frequency (~37) so names and typos surface as keywords, and the stemming edge cases for function words. It also documents the warnings key and the caveat that p_value is uncorrected, with a practical p < 0.0001 (g2 ≥ 15.13) threshold.

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?

Front-loaded with purpose and usage in the first two paragraphs, then results interpretation; every block has a function. It is dense and long, and the digression about dictionary entries the lemmatizer misses (его, ее, их, во, со) is niche detail that could be trimmed, plus the results paragraph partly restates the output schema.

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?

For a 9-parameter tool with an output schema, the description covers the setup prerequisite (dictionary download), normalization behavior, degenerate outcomes via warnings, and how to read the significance and effect-size fields. An agent has everything needed to call it and interpret the result correctly.

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 schema already carries parameter documentation; baseline is 3. The description does add interpretive value for measure ('мера сортировки и как ее читать'), the sign convention of g2/log_ratio, and the default reference dictionary, but it does not add per-parameter detail for top_n, min_freq, positive, or lemmatize beyond the schema.

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?

States a specific verb and resource: find words in a text that are significantly over- or under-represented relative to a reference. It also defines scope precisely by naming the two comparison modes (default frequency dictionary vs. another text via reference/reference_path), which separates it from generic analysis siblings.

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?

"Используйте, чтобы понять, чем лексика текста отличается от обычного языка … или от другого текста" gives an explicit use condition for both modes, and it flags the prerequisite of downloading the frequency dictionary via ruts-mcp download. It does not name a sibling (e.g. compare_texts) or state when to prefer that tool instead, so the boundary with siblings is left to inference.

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