Skip to main content
Glama

analyze_complexity

Analyze code complexity including cyclomatic complexity, cognitive complexity, nesting depth, and maintainability index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code snippet to analyze
languageNoProgramming language (optional, auto-detected if omitted)

TDQS

A3.5/5.0
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 of behavioral disclosure. It states what metrics are calculated but does not describe the output format, side effects, error handling, or any limitations. This is minimal transparency for an analysis tool.

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 a single, front-loaded sentence that begins with the verb+resource pair and then enumerates relevant metrics. Every word earns its place with no redundancy or fluff.

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?

With no output schema and no annotations, the description should explain return format or behavior, but it does not. It also lacks usage exclusions. However, the parameter schema is complete and the tool's scope is simple, making it adequate for basic understanding but incomplete for fully autonomous invocation.

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?

Schema description coverage is 100%, with clear descriptions for both 'code' and 'language' parameters. The tool description adds no parameter-specific semantics beyond the schema, so the baseline of 3 applies.

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 uses the specific verb 'Analyze' with resource 'code complexity' and explicitly lists four distinct metrics (cyclomatic complexity, cognitive complexity, nesting depth, maintainability index). This clearly distinguishes it from siblings like detect_language or explain_code, making the purpose unambiguous.

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 description implies usage for code complexity analysis, but provides no explicit when-to-use, exclusions, or alternative pointers. It does not differentiate from analyze_all or other siblings beyond the stated purpose, so usage guidance is merely implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct aspect of code analysis: language detection, explanation, docstring generation, complexity metrics, and refactoring suggestions. analyze_all is explicitly a combined wrapper, so agents won't confuse it with individual tools.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (e.g., detect_language, explain_code, generate_docstring). analyze_all uses the same verb-first structure, with 'all' as the object, preserving the convention.

Tool Count5/5

Six tools is an ideal size for a code analysis server, covering the main analysis categories without bloat. Each tool provides a distinct value and the combined analyze_all tool adds convenience without unnecessary overhead.

Completeness5/5

The tool surface comprehensively covers the domain of code explanation and analysis: language detection, natural-language explanation, docstring generation, complexity assessment, and refactoring suggestions. The analyze_all tool ensures all features are accessible in one call, leaving no obvious gaps for common code-explanation workflows.