Skip to main content
Glama

get_dead_code

Identifies unused code in projects using import/call graph analysis or entry-point reachability detection to help developers remove unnecessary files and improve codebase maintainability.

Instructions

Dead code detection. Two modes: (1) "multi-signal" (default) combines import graph, call graph, and barrel export analysis with confidence scores. (2) "reachability" runs forward BFS from auto-detected entry points (tests, package.json main/bin, src/{cli,main,index}, routes, framework-tagged controllers) — stricter but more accurate when entry points are enumerable. Pass entry_points to add custom roots. Both modes emit _methodology and _warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_patternNoFilter by file glob pattern (e.g. "src/tools/%")
thresholdNo[multi-signal mode] Min confidence to report (default: 0.5 = at least 2 of 3 signals)
limitNoMax results (default: 50)
modeNoDetection algorithm (default: multi-signal)
entry_pointsNo[reachability mode] Extra entry-point file paths (repo-relative)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: the two detection methodologies (combining import graph, call graph, barrel export analysis vs. forward BFS from entry points), confidence scoring, and output details ('emit _methodology and _warnings'). However, it lacks information on performance characteristics like execution time or resource usage.

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 efficiently structured: it starts with the core purpose, details the two modes with their algorithms and use cases, and ends with output behavior. Every sentence adds value, with no wasted words, making it easy to parse and understand quickly.

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 tool's complexity (5 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, methodologies, and output details. However, without an output schema, it could benefit from more specifics on the return format (e.g., structure of results), though it mentions '_methodology and _warnings'.

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

Parameters4/5

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

Schema description coverage is 100%, so the schema already documents all parameters. The description adds meaningful context beyond the schema: it explains the default 'threshold' value (0.5 = at least 2 of 3 signals), clarifies that 'entry_points' is for 'reachability mode', and distinguishes parameter applicability by mode. This enhances understanding without redundancy.

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 tool's purpose: 'Dead code detection' with two specific modes ('multi-signal' and 'reachability'). It distinguishes from siblings by focusing on dead code identification rather than other analysis tasks like 'get_dead_exports' or 'remove_dead_code', which have different scopes.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use each mode: 'multi-signal' is the default for general detection, while 'reachability' is 'stricter but more accurate when entry points are enumerable'. It also mentions passing 'entry_points' to add custom roots, offering clear alternatives based on context.

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/nikolai-vysotskyi/trace-mcp'

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