Skip to main content
Glama

get_dead_code

Surface unused exports, unreachable files, and zombie packages tiered by confidence so you can plan a cleanup sprint and remove dead code safely.

Instructions

Unused exports, unreachable files, zombie packages — tiered by confidence.

Run before a cleanup sprint, not a targeted fix. Findings tier
high/medium/low with per-directory and per-owner rollups; workspace
mode lowers confidence on findings other repos import.

Args:
    repo: usually omitted.
    kind: unreachable_file | unused_export | unused_internal | zombie_package.
        An unrecognised value is dropped and named in ignored_arguments,
        never applied as a filter that matches nothing.
    min_confidence: floor, default 0.4 (0.7 = cleanup-ready only). Also
        accepts a tier name: "high" | "medium" | "low".
    safe_only: deletion-ready findings only (no runtime-load risk).
    limit: max findings per tier (clamped to 25).
    tier: "high" | "medium" | "low", banded as min_confidence.
    directory: path-prefix filter.
    owner: primary-owner filter.
    group_by: "directory" | "owner" rollup.
    include_internals: also scan private symbols (more false positives).
    include_zombie_packages: monorepo package findings (default true).
    no_unreachable: skip file-level reachability findings.
    no_unused_exports: skip public-export findings.
    finding_id: stable ``id`` emitted by a dead-code finding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
repoNo
tierNo
limitNo
ownerNo
group_byNo
directoryNo
safe_onlyNo
finding_idNo
min_confidenceNo
no_unreachableNo
include_internalsNo
no_unused_exportsNo
include_zombie_packagesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.48.0
    • addedInput schema / properties / finding_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Finding Id"
      +}
  2. Changed2 schema fields changedv0.44.0
    • addedInput schema / properties / min_confidence / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / min_confidence / type
      Removed value: -"number"
  3. Changed1 schema field changedv0.39.0
    • changedInput schema / properties / min_confidence / default
      Previous value: -0.5New value: +0.4
  4. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: unrecognised kind values are dropped and surfaced in ignored_arguments rather than silently matching nothing, limit is clamped to 25, workspace mode degrades confidence on cross-repo imports, and safe_only restricts to deletion-ready findings with no runtime-load risk. These are exactly the non-obvious behaviors an agent needs before trusting results.

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?

Front-loaded with purpose, then usage guidance, then a dense args block where every line adds information. Slightly list-heavy with mild overlap between tier and min_confidence, but nothing is wasted and scanning is easy.

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?

For a 14-parameter tool with an output schema (so return shape needn't be explained) and no annotations, the description covers filters, defaults, edge cases, and rollups. The only soft spot is that the read-only nature of the operation is left implicit in the name rather than stated.

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

Parameters5/5

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

Schema coverage is 0%, and the description documents all 14 parameters anyway, including accepted enum values for kind/tier/group_by, the default 0.4 floor and the 0.7 cleanup-ready threshold, tier-name acceptance for min_confidence, the false-positive cost of include_internals, and the finding_id handoff. This fully compensates for the schema's missing descriptions.

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 opening line names the specific resources (unused exports, unreachable files, zombie packages) and the organizing concept (confidence tiering), which distinguishes it immediately from siblings like get_health, get_risk, and get_symbol. An agent can tell this is a dead-code analysis tool without opening the schema.

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?

"Run before a cleanup sprint, not a targeted fix" gives a clear when-to-use plus an explicit when-not, and the note about workspace mode lowering confidence adds situational context. It falls short of 5 only because the targeted-fix alternative (e.g. get_symbol or search_codebase) is implied rather than named.

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