Skip to main content
Glama

get_dead_code

Read-onlyIdempotent

Detect dead code using multi-signal analysis combining import, call graph, and barrel exports, or BFS reachability from entry points. Returns dead symbols with confidence scores.

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. Use for comprehensive dead code analysis. For quick export-only scan use get_dead_exports; to safely remove detected dead code use remove_dead_code. Read-only. Returns JSON: { dead_symbols: [{ symbol_id, name, file, confidence, signals }], total }.

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)
Behavior5/5

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

Beyond annotations (readOnlyHint, destructiveHint, idempotentHint), description details the two algorithms, mentions emitted fields (_methodology, _warnings), and states the tool is read-only. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single paragraph with clear structure: purpose, mode explanations, usage guidance, output summary. Front-loaded with key term. Minor redundancy but overall efficient.

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?

No output schema, but description specifies output structure (JSON with dead_symbols array, total, and attributes like confidence, signals). Covers all parameters, two modes, and entry point logic. Sufficient for a complex 5-parameter tool with multiple modes.

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?

All 5 parameters have schema descriptions (100% coverage), so baseline is 3. Description adds value by explaining mode-specific context (e.g., threshold default meaning, entry_points usage in reachability mode). Slightly above baseline.

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?

Description clearly states 'dead code detection', explains two modes with distinct behaviors, and explicitly names sibling tools get_dead_exports and remove_dead_code, distinguishing their use cases.

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?

Provides explicit guidance: when to use each mode, how to customize entry points, and when to use alternatives. Includes a direct statement: 'For quick export-only scan use get_dead_exports; to safely remove detected dead code use remove_dead_code.'

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