Skip to main content
Glama

dev_complexity

Read-only

Code complexity analyzer (cyclomatic complexity per function) — Offline McCabe cyclomatic complexity for a source file: every function and method with line, length, complexity, radon-style rank A-F, max nesting depth and parameter count, plus hotspots with refactoring hints, rank counts, average/max and a verdict SIMPLE / MODERATE / COMPLEX. Supports JavaScript/TypeScript, Python, Go, Java, Kotlin, C/C++, C#, PHP, Rust and Swift (auto-detected). Params: code (source text) or url (raw file or GitHub blob link), language (optional hint). Max 200,000 chars; no code is executed. Price: $0.004 USDC (Base, via x402).

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": {
      "code": "<code>"
    },
    "name": "dev_complexity"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYese.g. function f(x){ if (x > 1 && x < 9) { return 1 } return x ? 2 : 3 }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, destructiveHint false), and the description goes further by disclosing two things an agent genuinely needs: no code is executed, and calls cost $0.004 USDC via x402 on Base. It also states the 200,000-character hard limit. It stops short of describing failure modes (e.g. unsupported language, oversized input) which is why it is not a 5.

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 core purpose and the metric list are front-loaded in the first sentence, and the operational facts (languages, limits, price) follow in a logical order. It is dense but nearly every clause carries information; only the 'Params:' sentence is wasted because it describes parameters that the schema does not contain.

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?

With no output schema, the description correctly takes on the job of explaining the return payload — per-function rows, rank counts, averages/max, hotspots and a SIMPLE/MODERATE/COMPLEX verdict — and it covers language support and input size limits. The one completeness defect is the phantom url/language parameters, which leave the reader unsure which inputs are actually accepted.

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 coverage is 100% and there is only one parameter, so the schema already carries the burden; the description's added value is the example snippet. More importantly, it advertises 'url' and 'language' parameters that do not exist in the input schema, which can lead an agent to send arguments the tool will reject.

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 gives a specific verb and resource ('Offline McCabe cyclomatic complexity for a source file') and then enumerates exactly what is reported per function: line, length, complexity, rank A–F, nesting depth, parameter count, plus hotspots, rank counts and a verdict. No sibling in the list does static code analysis of this kind, so the tool is easy to tell apart.

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?

Usage is only implied — an agent can infer this is the tool for measuring code complexity rather than packaging or dependency tasks, but there is no explicit 'use this when…' statement and no named alternative for related questions. The supported-language list and auto-detection note help scope the call but are not routing guidance.

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.

Resources