Skip to main content
Glama

get_dead_code

Read-only

Scan a repository to identify unused exports, unreachable files, and zombie packages tiered by confidence, so you can plan cleanup sweeps and prioritize deletion-ready findings.

Instructions

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

For a cleanup sweep, not a targeted fix.

Args:
    kind: unreachable_file | unused_export | unused_internal | zombie_package.
    min_confidence: default 0.4 (0.7 = cleanup-ready), or a tier name.
    tier: "high" | "medium" | "low".
    safe_only: deletion-ready findings only.
    limit: max findings per tier (up to 25).
    directory, owner: path-prefix or primary-owner filter.
    group_by: "directory" | "owner".
    include_internals: also scan private symbols.
    include_zombie_packages, no_unreachable, no_unused_exports,
        include_unverified: switch finding kinds on or off.
    finding_id: one finding by its ``id``.
    repo: usually omitted.

Input Schema

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

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 schema fields changedv0.60.1
    • removedInput schema / properties / directory / default
      Removed value: -null
    • removedInput schema / properties / directory / title
      Removed value: -"Directory"
    • removedInput schema / properties / finding_id / default
      Removed value: -null
    • removedInput schema / properties / finding_id / title
      Removed value: -"Finding Id"
    • removedInput schema / properties / group_by / default
      Removed value: -null
    • removedInput schema / properties / group_by / title
      Removed value: -"Group By"
    • removedInput schema / properties / include_internals / title
      Removed value: -"Include Internals"
    • removedInput schema / properties / include_unverified / title
      Removed value: -"Include Unverified"
    • removedInput schema / properties / include_zombie_packages / title
      Removed value: -"Include Zombie Packages"
    • removedInput schema / properties / kind / default
      Removed value: -null
    • removedInput schema / properties / kind / title
      Removed value: -"Kind"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • removedInput schema / properties / min_confidence / title
      Removed value: -"Min Confidence"
    • removedInput schema / properties / no_unreachable / title
      Removed value: -"No Unreachable"
    • removedInput schema / properties / no_unused_exports / title
      Removed value: -"No Unused Exports"
    • removedInput schema / properties / owner / default
      Removed value: -null
    • removedInput schema / properties / owner / title
      Removed value: -"Owner"
    • removedInput schema / properties / repo / default
      Removed value: -null
    • removedInput schema / properties / repo / title
      Removed value: -"Repo"
    • removedInput schema / properties / safe_only / title
      Removed value: -"Safe Only"
    • removedInput schema / properties / tier / default
      Removed value: -null
    • removedInput schema / properties / tier / title
      Removed value: -"Tier"
    • removedInput schema / title
      Removed value: -"get_dead_codeArguments"
  2. Changed1 schema field changedv0.59.0
    • addedInput schema / properties / include_unverified
      Added value: +{
      +  "default": false,
      +  "title": "Include Unverified",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv0.48.0
    • addedInput schema / properties / finding_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Finding Id"
      +}
  4. 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"
  5. Changed1 schema field changedv0.39.0
    • changedInput schema / properties / min_confidence / default
      Previous value: -0.5New value: +0.4
  6. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety and locality are covered structurally. The description adds real behavioral context — confidence tiering, the meaning of safe_only (deletion-ready) and the 25-findings-per-tier cap — but says nothing about scan cost, latency, or how tiering interacts with min_confidence.

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?

A two-line headline states what it finds and how to think about it, then a dense arg list. No filler sentences, and the most decision-relevant point (sweep vs targeted fix) is front-loaded.

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?

An output schema exists, so return values need not be explained, and all 15 parameters are addressed. What's missing is guidance on how filters compose (e.g., passing kind alongside the no_* toggles, or tier vs min_confidence precedence) and any note on scan scope cost for a 15-parameter repository tool.

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?

With 0% schema description coverage across 15 parameters, the description carries the entire burden and largely discharges it: kind's four values, min_confidence accepting either a number or a tier name with its 0.4 default, limit's ceiling, filter semantics for directory/owner, and explicit meaning for finding_id and repo. The bundled boolean toggles are described collectively rather than individually, which is a minor compression but still understandable.

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?

The opening line names the exact finding types the tool produces (unused exports, unreachable files, zombie packages) and frames them as confidence-tiered, which is far more specific than the name alone. It does not name a sibling tool to contrast with (get_health or get_risk could plausibly overlap), so the agent must infer the boundary.

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?

"For a cleanup sweep, not a targeted fix" plus the min_confidence hint (0.7 = cleanup-ready) and safe_only as deletion-ready give a clear picture of when this tool applies. It never names an alternative tool for the targeted-fix case, so the exclusion half of the guidance is left implicit.

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