Skip to main content
Glama

find_complexity

Lists functions and methods whose cyclomatic complexity exceeds a set threshold, helping identify code that is harder to test and more likely to hide bugs.

Instructions

List functions and methods with cyclomatic complexity above a threshold. Higher complexity = harder to test, more likely to hide bugs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_path": "<repo_path>"
    },
    "name": "find_complexity"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
repo_pathYes
thresholdNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and it discloses very little: it does not say the operation is read-only, what happens with an invalid repo_path, how results are ordered, or how 'limit' interacts with the threshold filter. The return shape is covered by the output schema, but the behavioral contract around execution is not.

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?

Two tight sentences with the capability front-loaded and the rationale second; nothing is redundant. The rationale sentence is mild justification rather than operational detail, which is the only minor inefficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter analysis tool with zero annotation coverage and zero schema documentation, the description should at minimum explain the two optional parameters and their defaults. The output schema covers return values, but the input contract is left entirely unexplained.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across three parameters, so the description must compensate and largely does not. It references the concept of a threshold but never gives the default (10), the meaning of 'limit' (default 50, presumably max results), or the expected form of repo_path.

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 ('List functions and methods') plus the filtering criterion ('cyclomatic complexity above a threshold'), so the agent knows exactly what comes back. It does not distinguish itself from plausible siblings such as find_long_functions or find_god_files, which keeps it from a 5.

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 second sentence ('Higher complexity = harder to test, more likely to hide bugs') implies the use case — pre-refactor or maintainability review — but never states when to pick this over the sibling analyzers or any prerequisite such as having the repo indexed. Usage is inferable rather than directed.

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