Skip to main content
Glama
ellmos-codecommander-mcp

ellmos-codecommander-mcp

Analyze Code

cc_analyze_code
Read-onlyIdempotent

Analyze Python, JavaScript, or TypeScript files to extract classes, functions, imports, lines of code, and complexity metrics for code review and maintenance.

Instructions

Analyzes a Python, JavaScript, or TypeScript file: classes, functions, imports, metrics.

Args:

  • path (string): Path to a .py, .js/.jsx/.mjs/.cjs, or .ts/.tsx/.mts/.cts file

Returns:

  • Classes with methods, functions, import analysis, LOC, complexity

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": {
      "path": "<path>"
    },
    "name": "cc_analyze_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to a supported Python, JavaScript, or TypeScript file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.3.27
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / path / description
      Previous value: -"Path to the Python file"New value: +"Path to a supported Python, JavaScript, or TypeScript file"
  2. First observedv1.3.8

TDQS

A4.6/5.0
Behavior4/5

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

The description adds value by detailing the *content* of the output, specifying that the analysis includes metrics (LOC, complexity) and structural details (imports, functions). This information is not contained in the behavioral hints provided in the annotations.

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 structure is highly efficient, using standard markdown sections (Args, Returns) to clearly segment the input and expected output information without unnecessary verbiage.

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

Completeness5/5

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

Given that there is no output schema, the description is excellent for completeness, listing all the specific return values (Classes with methods, functions, import analysis, LOC, complexity) that the AI needs to understand the tool's utility.

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

Parameters5/5

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

The description goes beyond the generic schema description to list every specific file extension supported by the tool (.py, .js/.jsx/.mjs/.cjs, etc.), which is a critical semantic detail for the user to ensure correct tool invocation.

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 definition explicitly states it performs a holistic analysis of source code across three specific languages (Python, JavaScript, TypeScript). It clearly defines the scope by listing all components assessed: classes, functions, imports, and metrics.

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

Usage Guidelines4/5

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

While it does not explicitly say 'do not use this if you only want classes,' the listing of detailed analysis outputs (e.g., LOC, complexity) implicitly guides the user to use it over more granular sibling tools like cc_extract_classes or cc_diagnose_imports.

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