Skip to main content
Glama

analyze_dead_code

Identify unused functions, classes, and modules in your codebase, providing file paths, line numbers, severity, and fix suggestions.

Instructions

Analyze a codebase for dead code — functions, classes, and modules that are defined but never referenced. Returns findings with file paths, line numbers, severity, and fix suggestions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathNoPath or URL to the repository to analyze
include_suggestionsNoWhether to include fix suggestions

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4/5.0
Behavior3/5

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

Without annotations, the description carries the burden of explaining behavior. It does disclose that the tool returns findings with file paths, line numbers, severity, and fix suggestions, which implies a non-mutating analysis. However, it never explicitly says the tool is read-only or that it does not apply fixes, leaving some behavioral ambiguity for an agent.

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, information-dense sentence. It front-loads the core purpose, then adds a useful definition of dead code and the expected output structure without any filler or redundancy.

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?

Given the simple two-parameter schema and no output schema, the description compensates well by explaining both what is detected and what the return findings contain. It is mostly complete, though a note about supported languages or explicit confirmation that the tool does not modify code would make it fully self-sufficient.

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 the parameters repo_path and include_suggestions are already documented. The description adds marginal value by mentioning 'fix suggestions,' which aligns with include_suggestions, but it does not elaborate on parameter-specific behavior beyond the schema.

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 clearly states the verb 'Analyze', the resource ('a codebase'), and the specific target (dead code: functions, classes, and modules defined but never referenced). This definition alone distinguishes the tool from siblings like analyze_coupling and detect_circular_deps, since each targets a different code quality concern.

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?

The description gives clear context: use this tool when the need is to find unused definitions, and it specifies exactly what counts as dead code. It does not explicitly name alternatives or exclusions, but the scoped language makes the appropriate use case obvious relative to the sibling tools.

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