Skip to main content
Glama

Complexity Report

complexity_report
Read-onlyIdempotent

Report structural complexity of a source file, function by function. FREE.

Measures per-function length, max nesting depth, and a cyclomatic-style branch count (if/for/while/case/&&/||/except), flagging functions too long or too deeply nested to review confidently. Typical input {"code": ""} returns {"functions": N, "detail": [{"name": ..., "start": N, "lines": N, "branches": N, "max_depth": N}], "flags": ["..."], "note": "..."}.

Use when structure rather than correctness is the question. Not for vulnerabilities (security_deep_dive). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""}. Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesFull source text to analyze, pasted as a single string.
languageNoOptional language hint, e.g. "python" or "javascript"; "auto" (default) detects from syntax.auto

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already provide readOnlyHint: true and idempotentHint: true. The description adds important context: 'Every call is read-only and idempotent', and details the error format ('returns {"error": ...}') and retry advice. Since annotations already handle the behavioral safety profile, the description earns a high score for supplementing with error-handling specifics without contradiction.

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 tightly written with no wasted sentences. It front-loads the core purpose in the first line, then provides example input/output, usage guidance, sibling differentiation, error handling, and behavioral notes—all in a compact, well-structured paragraph.

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?

Given the tool's complexity (2 parameters, clear output schema, strong annotations), the description is nearly complete. It covers purpose, usage, error behavior, and idempotency. Minor omission: it doesn't mention the output schema return shape beyond the example, but the presence of an output schema in the context signals reduces the need.

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 high (100%) for the two parameters. The description adds some semantic context beyond the schema by showing a typical input example ({"code": "<file contents>"}), but does not provide additional detail beyond what the schema describes for each parameter. Baseline 3 is appropriate as schema already handles the burden.

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 explicitly states 'Report structural complexity of a source file, function by function', with a specific verb ('report') and resource ('complexity of a source file'). The detail on what metrics are measured (length, nesting depth, branch count) and the flagging behavior clearly distinguishes this from siblings like 'security_deep_dive' or 'ai_code_smell_scan'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

The description gives explicit guidance: 'Use when structure rather than correctness is the question. Not for vulnerabilities (security_deep_dive).' It also explains error behavior and retry safety, helping the agent decide when to invoke this tool and when to choose an alternative.

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.6/5.0
Disambiguation5/5

Each tool targets a distinct analysis area: AI-generated code smells, structural complexity, reviewer persona, review checklist, diff risk scanning, secret scanning, and OWASP security deep dive. Even though review_diff and security_deep_dive both touch security, one is diff-based and the other is full-file, and descriptions clarify the difference.

Naming Consistency4/5

All names use snake_case, but there is a mix of verb-first (ai_code_smell_scan, get_reviewer_persona, secret_scan) and noun-first (complexity_report, review_checklist, review_diff, security_deep_dive) patterns. This is mostly consistent but the verb usage varies (scan, get, report, checklist, dive).

Tool Count5/5

7 tools is well-scoped for a code review analysis server. Each tool serves a specific purpose without overlap, covering multiple angles (AI smells, complexity, security, secrets, diff review, checklist, persona) without being overwhelming.

Completeness4/5

The tool set covers essential static analysis tasks for code review: structural, security, secret detection, and AI-generated code detection. It also provides supporting tools (checklist, persona). A minor gap is the lack of an integrated tool that produces a consolidated review summary or comment generation from findings.

Resources