Skip to main content
Glama

get_complexity_report

Analyze code complexity metrics like cyclomatic complexity and nesting depth to identify areas needing refactoring in specific files or across projects.

Instructions

Get complexity metrics (cyclomatic, max nesting, param count) for symbols in a file or across the project. Useful for identifying complex code before refactoring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNoFile path to report on (omit for project-wide top complex symbols)
min_cyclomaticNoMin cyclomatic complexity to include (default: 1 for file, 5 for project)
limitNoMax results (default: 30)
sort_byNoSort by metric (default: cyclomatic)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool's purpose and use case but lacks details on behavioral traits such as permissions needed, rate limits, whether it's read-only or has side effects, or what the output format looks like (especially since there's no output schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence, followed by a brief usage note. Both sentences earn their place by adding value without redundancy.

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

Completeness3/5

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

Given the complexity of a 4-parameter tool with no annotations and no output schema, the description is adequate but has clear gaps. It explains what the tool does and its use case, but it lacks details on behavioral aspects and output, which are important for an agent to invoke it correctly.

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?

The input schema has 100% description coverage, so the baseline is 3. The description adds minimal value beyond the schema by implying the tool can operate on a file or project-wide, but it does not provide additional syntax, format details, or examples for the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get complexity metrics') and resources ('symbols in a file or across the project'), and it distinguishes from siblings by focusing on complexity metrics rather than other analysis types like 'get_call_graph' or 'get_dead_code'.

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?

The description provides clear context for when to use the tool ('Useful for identifying complex code before refactoring'), but it does not explicitly state when not to use it or name specific alternatives among the many sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolai-vysotskyi/trace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server