Skip to main content
Glama

analyze_code

Destructive

Analyze Python code quality by detecting complexity, dead code, clones, and coupling metrics to identify improvement areas and maintain code health.

Instructions

Comprehensive Python code quality analysis with complexity, dead code, clone detection, and coupling metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysesNoArray of analyses to run. Options: complexity, dead_code, clone, cbo, deps. Default: all analyses
pathYesPath to Python code (file or directory) to analyze
recursiveNoRecursively analyze directories (default: true)
Behavior3/5

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

Annotations provide key behavioral hints (destructiveHint: true, readOnlyHint: false, etc.), so the description doesn't need to repeat these. It adds value by specifying the types of analyses performed (complexity, dead code, etc.), but doesn't elaborate on side effects, rate limits, or output format beyond what annotations cover.

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 a single, efficient sentence that front-loads the purpose and lists key analyses without unnecessary details. Every word contributes to understanding the tool's scope, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's complexity (multiple analysis types, destructive hint) and lack of output schema, the description is adequate but incomplete. It covers what analyses are performed but doesn't explain output format, error handling, or how results are returned, leaving gaps for an agent to invoke it correctly.

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 100%, so parameters are well-documented in the schema. The description adds minimal semantics by listing analysis types (e.g., complexity, dead_code) that align with the enum options, but doesn't provide additional context beyond what the schema already specifies.

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 clearly states the tool performs 'Python code quality analysis' with specific metrics (complexity, dead code, clone detection, coupling), which is a specific verb+resource. However, it doesn't explicitly differentiate from sibling tools like check_complexity or detect_clones, which appear to handle individual analyses.

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?

The description provides no guidance on when to use this tool versus its siblings. It mentions 'comprehensive' analysis but doesn't specify scenarios where this is preferred over individual analysis tools like check_complexity or detect_clones, nor does it mention prerequisites or exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lesleslie/session-buddy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server