Skip to main content
Glama

bsl_complexity

Calculates cognitive and cyclomatic complexity for 1C BSL module methods to help reviewers identify complex code by module, path, or function.

Instructions

Сложность методов модуля (когнитивная + цикломатическая). Метрика ревьюеру. РОВНО ОДИН адрес: module_full_name — 'ОбщийМодуль.МойМодуль' | 'Отчет.Х' (все модули объекта) | форма; ИЛИ path — любой локальный .bsl или каталог: внешняя обработка, расширение тестов, выгрузка ревизии MR (full_name — имя модуля 1С, где его можно определить, иначе путь от path). function (опц.) — только этот метод или перечень через запятую; ненайденный метод — ошибка «метод не найден».

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

Input Schema

NameRequiredDescriptionDefault
pathNo
functionNo
module_full_nameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.14.0
    • addedInput schema / properties / module_full_name / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / module_full_name / default
      Added value: +null
    • removedInput schema / properties / module_full_name / type
      Removed value: -"string"
    • addedInput schema / properties / path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Path"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "module_full_name"
      -]
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden: it does disclose error behavior (unfound method raises 'метод не найден') and the fallback rule that full_name resolves from a path. It does not say what happens if zero or both addresses are given, nor confirm the operation is a non-mutating read, leaving meaningful gaps for an unannotated tool.

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 in the first sentence and the addressing rule follows immediately. The parenthetical covering path variants is dense but every clause conveys distinct accepted input forms rather than padding.

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?

An output schema exists, so return values need not be explained, and the description covers all three parameters plus the address-selection rule and the not-found error. What remains missing is only the edge case of missing or conflicting addresses.

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 0%, so the description must compensate and largely does: it enumerates the accepted module_full_name forms ('ОбщийМодуль.МойМодуль', 'Отчет.Х', форма), describes path as a .bsl file, directory, external processing, extension or MR revision dump, and explains function as a single method or comma-separated list.

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+resource: computes cognitive and cyclomatic complexity of module methods ('Сложность методов модуля (когнитивная + цикломатическая)'). It is clearly a metrics tool rather than a linter or reference lookup, which separates it from bsl_rules_check and bsl_diagnostics, though it never names a sibling explicitly.

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?

The constraint 'РОВНО ОДИН адрес' tells the agent it must supply either module_full_name or path, and lists which forms each accepts, which is genuinely useful routing guidance. However, there is no statement of when to prefer this over bsl_rules_check or bsl_diagnostics, and no explicit exclusion of cases.

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