Skip to main content
Glama
JohnMarzulli

TsComplexityMcp

by JohnMarzulli

analyze_typescript_complexity

Scores the complexity of a single TypeScript function using tsmetrics-core, returning JSON breakdown to help enforce complexity limits and prevent overly complex code.

Instructions

Scores the complexity of a single TypeScript function with tsmetrics-core. Returns JSON { total, details: [{ startLine, endLine, complexity, description }] }; lines are 1-based within the snippet.

Input Schema

NameRequiredDescriptionDefault
codeYesSource of exactly one TypeScript function.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations exist, so the description carries the full disclosure burden. It does useful work by specifying the return payload shape and the 1-based, snippet-relative line numbering, but says nothing about failure modes, unsupported syntax, or size limits — significant gaps for an unannotated 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?

Two tight sentences with zero filler; the primary purpose leads, and the return contract follows immediately. Every clause carries information an agent would otherwise have to infer.

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?

Because no output schema exists, the description rightly documents the return object and line-numbering convention, which is the highest-value missing structured data. Error handling and metric definition remain unspecified, but for a single-input pure computation this is close to sufficient.

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

Parameters4/5

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

Single parameter with 100% schema coverage, so baseline is 4. The description reinforces the schema's key constraint ('exactly one TypeScript function') rather than repeating it blindly, though it adds no syntax or format detail beyond that.

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?

Names a specific verb and resource ('Scores the complexity of a single TypeScript function') and identifies the underlying engine (tsmetrics-core). The only residual vagueness is which complexity metric is produced, but the scope is unambiguous and there are no siblings to confuse.

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 implied by the scope: feed it exactly one function's source. It never states when to reach for this versus other analysis approaches, nor what happens with invalid TypeScript or multi-function input. With no siblings the omission is tolerable but the guidance is only inferred.

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

Deploy Server

Other Tools