Skip to main content
Glama

Find dead code

analyze
Read-only

Find dead code in a project: unused functions, classes, imports, variables, parameters, and files. Returns JSON cleanup candidates; read-only, no code edits.

Instructions

Find dead code: unused functions, classes, imports, variables, parameters and files.

Use this to list cleanup candidates in a project. Returns JSON with a summary and per-category findings (file, line, name, confidence) plus _run_id; the full result is stored locally and can be read from the skylos://results/{run_id} resource. Read-only: it never edits code. Findings are candidates: before deleting one, check for dynamic use (getattr, string dispatch, entry points, framework decorators, tests). A non-empty analysis_errors means analysis or verification was incomplete; do not treat the findings as a complete scan.

Defect and Review records remain complete. Advice is grouped by default; expand_advice=True includes every Advice record. Read _result_uri for the complete saved result without rescanning.

Works without SKYLOS_API_KEY (5 calls/day); higher limits with a key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDirectory or file to scan. A relative path resolves against the MCP server's working directory.
confidenceNoMinimum confidence (0-100) for dead-code findings. Higher values report fewer, surer candidates; 60 is the CLI default.
expand_adviceNoInclude every Advice record instead of rule-group counts; complete results are always available through _result_uri.
exclude_foldersNoFolder names to skip, e.g. ["migrations", "scripts"]. When given, this list replaces the default excludes (node_modules, .venv, build, dist and similar); omit it to keep the defaults.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.49.0
    • addedInput schema / properties / confidence / description
      Added value: +"Minimum confidence (0-100) for dead-code findings. Higher values report fewer, surer candidates; 60 is the CLI default."
    • addedInput schema / properties / exclude_folders / description
      Added value: +"Folder names to skip, e.g. [\"migrations\", \"scripts\"]. When given, this list replaces the default excludes (node_modules, .venv, build, dist and similar); omit it to keep the defaults."
    • addedInput schema / properties / expand_advice
      Added value: +{
      +  "default": false,
      +  "description": "Include every Advice record instead of rule-group counts; complete results are always available through _result_uri.",
      +  "title": "Expand Advice",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / path / description
      Added value: +"Directory or file to scan. A relative path resolves against the MCP server's working directory."
  2. Addedv4.10.0

TDQS

A4.1/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the read-only nature is restated, results are persisted locally and readable via the `skylos://results/{run_id}` resource, findings are explicitly advisory candidates, and a non-empty `analysis_errors` signals an incomplete scan. It even discloses the rate-limit profile (works without an API key at 5 calls/day).

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?

Purpose and return shape are front-loaded and most sentences earn their place. The "Defect and Review records remain complete" paragraph introduces categories (Defect/Review) not referenced elsewhere, which slightly muddies an otherwise tight description.

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?

Despite an output schema being present, the description still conveys the important non-obvious facts: candidate nature of findings, the persistence resource, the analysis_errors caveat, and usage limits. An agent has everything needed to run it and interpret results 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 the baseline is 3. The description adds a little meaning for expand_advice (grouped Advice by default) and reiterates `_result_uri`, but confidence and exclude_folders semantics live almost entirely in the schema, so it does not clearly exceed the schema's own value.

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?

Opens with a specific verb+resource and enumerates the exact categories scanned (unused functions, classes, imports, variables, parameters, files), so an agent knows precisely what it produces. It does not differentiate from the close sibling verify_dead_code, which is left unmentioned, so it falls just short of 5.

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?

"Use this to list cleanup candidates in a project" gives clear positive usage context, and the warning to check dynamic use before deleting is useful preconditions guidance. However, it names no alternative tool (e.g. verify_dead_code or generate_fix) and states no explicit when-not, so alternatives are left to inference.

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