Skip to main content
Glama

Коллокации

collocations
Read-onlyIdempotent

Find statistically significant word pairs and stable combinations in Russian text, optionally filtered by a node word, to identify terminology and typical word usage.

Instructions

Найти коллокации текста - пары слов, которые встречаются вместе чаще, чем случайно.

Используйте для устойчивых сочетаний, терминологии и сочетаемости слова (параметр node). Пара упорядочена: правое слово стоит не дальше window слов после левого. Леммы pymorphy3 берутся без снятия омонимии.

В результате "n_words" - число слов текста, "measure" - мера и как ее читать, "collocations" - пары по убыванию меры: левое слово "left", правое "right", их частоты "freq_left" и "freq_right", частота пары "freq_pair" и значение меры "score". freq_pair - число пар позиций, где правое слово стоит в окне после левого: слово, повторенное в окне, дает несколько пар, поэтому freq_pair бывает больше частоты слова, и такая пара - повтор, а не устойчивое сочетание. Ключ "warnings" - предупреждения: текст не на русском языке, слова node нет в тексте, пар с такой частотой нет.

Input Schema

NameRequiredDescriptionDefault
nodeNoСлово, сочетаемость которого нужна; не задано - все пары
pathNoАбсолютный путь к текстовому файлу в UTF-8 на машине, где запущен сервер, вместо text: длинный текст не нужно пересылать в аргументе
textNoТекст на русском языке; вместо него можно задать path
top_nNoЧисло коллокаций в ответе
windowNoНаибольшее расстояние между словами пары; 1 - биграммы
measureNoМера ассоциации: logdice - устойчивость пары, не зависит от размера текста; mi завышает редкие пары; mi3 и t_score отдают предпочтение частымlogdice
min_freqNoНаименьшее значение freq_pair - числа пар позиций в окне
lemmatizeNoСравнивать леммы: «точка зрения» и «точки зрения» - одна пара

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only declare readOnly, openWorld=false, and idempotent; the description adds substantial behavioral context: ordered left/right pairs within the window, pymorphy3 lemmatization without homonym disambiguation, interpretation of freq_pair as repeated pairs rather than stable collocations, and warning conditions. There is no contradiction with the 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 purpose is front-loaded, and the description is organized into clear paragraphs covering usage, pair ordering, output interpretation, and warnings. The detailed output-field explanation is partly redundant because an output schema exists, making it slightly longer than necessary, though most content earns its place.

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 an 8-parameter analytical tool with annotations and an output schema, the description supplies enough context to call and interpret it correctly: purpose, use cases, pair ordering, frequency interpretation, and warning behavior. No critical gap remains for an agent deciding how to use this tool.

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

Parameters4/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, but the description adds meaning beyond the schema by clarifying directional window ordering and the lemmatization caveat. It adds little for parameters like top_n or min_freq beyond what the schema already says, so it is not a 5.

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?

States a specific verb and resource: 'Найти коллокации текста' and defines collocations as word pairs occurring together more often than chance. It does not distinguish this tool from siblings such as kwic or dispersion, so it is clear but lacks explicit sibling differentiation.

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?

Gives intended use cases ('устойчивых сочетаний, терминологии и сочетаемости слова') and points to the node parameter. However, it provides no when-not guidance and does not name alternatives among the sibling tools, leaving usage selection implied rather than explicit.

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