Skip to main content
Glama

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

keyness
Read-onlyIdempotent

Identify keywords in Russian text by comparing word frequencies against a reference or frequency dictionary. Use it to reveal vocabulary that is significantly more or less common than baseline.

Instructions

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

Используйте, чтобы понять, чем лексика текста отличается от обычного языка (эталон по умолчанию - частотный словарь, его нужно скачать командой ruts-mcp download) или от другого текста (reference или reference_path). Слова сравниваются в нижнем регистре и с е вместо ё, леммы - ruMorph в контексте предложения. Со словарем числа, слова с латиницей и сокращения без своей статьи, которые ruMorph раскрывает в другое слово (тов., г.), отбрасываются, а слово вне словаря получает его наименьшую частоту (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" - предупреждения: текст не на русском языке, ключевых слов нет.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "keyness"
  }
}

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

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/openWorldHint=false, yet the description adds real behavioral detail: lowercasing, е-for-ё normalization, sentence-context ruMorph lemmatization, discarding of numbers/Latin tokens/unexpanded abbreviations, and the OOV rule that assigns the dictionary's minimum frequency (~37), which explains why names and typos surface as keywords. It also warns that p-values are uncorrected. The trade-off is that much of the text describes the response payload rather than behavior.

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?

Purpose and usage are front-loaded, which is good, but the third paragraph is a long enumeration of result keys (freq_target, ipm_*, g2, p_value, log_ratio, score, warnings) that duplicates the declared output schema. The density is high and some sentences serve output documentation rather than tool selection.

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?

For a 9-parameter statistical tool the definition is substantively complete: it covers the default reference and download prerequisite, preprocessing, OOV handling, the significance threshold (p < 0.0001 / g2 15.13) and warning conditions. An output schema exists, so the extensive return-value narrative is redundant rather than missing information.

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 baseline is 3; the schema already documents path/text, top_n, measure, min_freq, positive, lemmatize and both reference parameters. The description's main added value is operational — that the default reference is a frequency dictionary that must be downloaded first — but it restates the lemmatize and reference semantics rather than extending them.

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 opening sentence gives a specific verb and resource: find the text's keywords, defined as words significantly more (or less) frequent than in a reference. The second sentence clarifies the two comparison modes (default frequency dictionary vs. another text via reference/reference_path). It never names a sibling such as compare_texts, so an agent must infer the distinction from the statistical framing alone.

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?

It states the use case explicitly ('Используйте, чтобы понять, чем лексика текста отличается от обычного языка ... или от другого текста') and includes a prerequisite: the default dictionary must first be fetched with 'ruts-mcp download'. No explicit when-not conditions or named alternative tools are given, so the routing decision is only partly supported.

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