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. Dates show when Glama detected each change.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must disclose behavior. It mentions the detection criteria and the 'returns findings' structure, which indicates a read-only analysis. However, it does not disclose potential limitations such as language support, repository size constraints, or whether it modifies files. It adds some behavioral context but lacks depth.

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 two sentences, with the core purpose front-loaded in the first sentence. It avoids redundancy and every phrase conveys essential information (scope, detection target, output contents).

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?

The description is concise but covers the key invocation details: input (repo_path), an optional toggle, and the expected output fields (file paths, line numbers, severity, fix suggestions). Given the tool's simplicity and full schema coverage, this is arguably sufficient, though it omits any guidance on language support or when to choose this over siblings.

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?

Both parameters are already described in the schema with full coverage, so the baseline is 3. The description reinforces that include_suggestions controls fix suggestions, but adds no additional syntax or format details 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?

States a specific verb 'Analyze' with resource 'codebase' for 'dead code' and specifies the kinds of dead code (functions, classes, modules) and that they are 'defined but never referenced.' This clearly distinguishes from sibling tools like detect_circular_deps or analyze_coupling, which focus on different aspects.

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 siblings. It does not mention alternatives, exclusions, or prerequisites, leaving an agent to infer usage from the name and sibling titles alone.

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

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/icohangar-ops/codesentinel'

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