Skip to main content
Glama

data-api-code

js_code_complexity_analyze

Analyze JavaScript/TypeScript source code for function declarations, import/export dependencies, cyclomatic complexity branches, and LOC metrics.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "js_code_complexity_analyze"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNo
filePathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and does not meet it. It never states that the operation is read-only, whether code is executed or merely parsed, what permissions or filesystem access are needed, or what the response looks like. Only the list of analyzed constructs gives any behavioral signal.

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?

A single front-loaded sentence that wastes no words and puts the resource before the enumerated metrics. The list is dense but every item adds discriminating information.

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

Completeness2/5

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

For a tool with no annotations, no output schema, and zero parameter documentation, the description should explain input mode selection and return shape. It covers only what is analyzed, leaving the agent unable to determine how to supply source or what it will receive back.

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 description coverage is 0% for both parameters, so the description must compensate and does not: it never mentions `text` versus `filePath`, which source takes precedence, whether both may be supplied, or that both are optional (required=0). The core invocation question is left entirely to inference from parameter names.

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?

The description names a specific verb ("Analyze") and resource ("JavaScript/TypeScript source code") and enumerates the exact outputs: function declarations, import/export dependencies, cyclomatic complexity branches, and LOC metrics. An agent can tell this apart from the sibling converters/validators, though it doesn't explicitly say so.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no mention of alternatives, and no preconditions such as file access or supported language variants. Nothing tells the agent under which circumstances this tool is the right pick versus another analysis tool.

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