Skip to main content
Glama

Коллокации

collocations
Read-onlyIdempotent

Find collocations in Russian text by detecting word pairs that co-occur more often than chance, useful for stable phrases, terminology, and compatibility checks.

Instructions

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

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

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

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": "collocations"
  }
}

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?

Beyond the read-only/idempotent annotations, it discloses important behavior: the ordered left-right pair constraint relative to window, ruMorph lemmatization in sentence context, how freq_pair counts overlapping pairs and why it can exceed word frequency, and the meaning of the warnings key. These are exactly the operational details an agent needs beyond the safety profile.

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?

The purpose and usage are front-loaded, but a large second paragraph explains return fields at length even though an output schema exists, making that portion partly redundant. The phrase "measure - мера и как ее читать" is also vague rather than informative.

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 an 8-parameter tool with an output schema and annotations, the description covers purpose, usage context, pair/window semantics, lemmatization behavior, edge-case warnings, and output interpretation. It is nearly complete; the main missing element is explicit guidance on which sibling tool to use instead for related tasks.

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 coverage is 100%, so the baseline is 3, but the description adds meaning not present in the schema: it explains node as the word whose combinability is sought, clarifies the ordered window semantics ("правое слово стоит не дальше window слов после левого"), and notes that lemmas are resolved in sentence context. This meaningfully supplements the parameter documentation.

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 description states a specific verb and resource: finding collocations, defined precisely as word pairs that co-occur more often than by chance. It does not explicitly distinguish itself from sibling tools such as kwic or analyze_text, so it falls short of the 5 criterion for 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 Guidelines4/5

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

It gives clear usage context: "Используйте для устойчивых сочетаний, терминологии и сочетаемости слова (параметр node)." However, it names no alternative tools and gives no when-not-to-use guidance, so it meets the 4 level rather than 5.

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