Skip to main content
Glama
timohaa

Scopewalker MCP

by timohaa

Dead Code

find_dead_code
Read-onlyIdempotent

Scan your codebase to find declared symbols with no references, distinguishing proven unreachable code from possibly externally used exports. Use it to clean up dead code and reduce maintenance.

Instructions

Finds declared symbols that nothing references. dead_code is proven unreachable within the scan; unreferenced_exports may be used outside it.

Input Schema

NameRequiredDescriptionDefault
pathYesFile or directory to analyze; must be inside the allowed roots
limitNoMax items returned per result list (default 20)
max_depthNoMax directory depth to descend (default unlimited)
max_filesNoStop after scanning this many files (default unlimited)
extensionsNoOnly scan these extensions, e.g. [".ts", ".py"] (default all supported)
include_hiddenNoInclude dotfiles and dot-directories (default false)
ignore_patternsNoExtra gitignore-style patterns to exclude, relative to path

Output Schema

NameRequiredDescriptionDefault
pathYes
_metaNo
summaryYes
dead_codeYes
is_directoryYes
unreferenced_exportsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.4.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / extensions / description
      Previous value: -"Filter by extensions"New value: +"Only scan these extensions, e.g. [\".ts\", \".py\"] (default all supported)"
    • changedInput schema / properties / ignore_patterns / description
      Previous value: -"Exclude patterns"New value: +"Extra gitignore-style patterns to exclude, relative to path"
    • changedInput schema / properties / include_hidden / description
      Previous value: -"Include hidden"New value: +"Include dotfiles and dot-directories (default false)"
    • changedInput schema / properties / limit / description
      Previous value: -"Max results per list"New value: +"Max items returned per result list (default 20)"
    • changedInput schema / properties / max_depth / description
      Previous value: -"Max depth"New value: +"Max directory depth to descend (default unlimited)"
    • changedInput schema / properties / max_files / description
      Previous value: -"Max files to scan"New value: +"Stop after scanning this many files (default unlimited)"
    • changedInput schema / properties / path / description
      Previous value: -"Target path"New value: +"File or directory to analyze; must be inside the allowed roots"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "_meta": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "funding": {
      +          "type": "string"
      +        },
      +        "item_count": {
      +          "type": "number"
      +        },
      +        "response_size_chars": {
      +          "type": "number"
      +        },
      +        "warning": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "item_count",
      +        "response_size_chars",
      +        "funding"
      +      ],
      +      "type": "object"
      +    },
      +    "dead_code": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "file": {
      +            "type": "string"
      +          },
      +          "line": {
      +            "type": "number"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "class",
      +                  "function",
      +                  "interface",
      +                  "enum",
      +                  "constant"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "const": "method",
      +                "type": "string"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "file",
      +          "name",
      +          "type",
      +          "line"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "is_directory": {
      +      "type": "boolean"
      +    },
      +    "path": {
      +      "type": "string"
      +    },
      +    "summary": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "dead_code_found": {
      +          "type": "number"
      +        },
      +        "files_scanned": {
      +          "type": "number"
      +        },
      +        "files_skipped": {
      +          "type": "number"
      +        },
      +        "scan_complete": {
      +          "type": "boolean"
      +        },
      +        "symbols_checked": {
      +          "type": "number"
      +        },
      +        "unreferenced_exports_found": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "files_scanned",
      +        "files_skipped",
      +        "scan_complete",
      +        "symbols_checked",
      +        "dead_code_found",
      +        "unreferenced_exports_found"
      +      ],
      +      "type": "object"
      +    },
      +    "unreferenced_exports": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "file": {
      +            "type": "string"
      +          },
      +          "line": {
      +            "type": "number"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "class",
      +                  "function",
      +                  "interface",
      +                  "enum",
      +                  "constant"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "const": "method",
      +                "type": "string"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "file",
      +          "name",
      +          "type",
      +          "line"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "path",
      +    "is_directory",
      +    "dead_code",
      +    "unreferenced_exports",
      +    "summary"
      +  ],
      +  "type": "object"
      +}
  2. Addedv1.3.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the bar is low. The description still adds real value by distinguishing 'dead_code' (proven unreachable in the scan) from 'unreferenced_exports' (may be used outside it), which warns the agent off false positives. It does not mention scan cost or truncation behavior, but that is minor here.

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?

Two sentences, zero filler, and the core purpose is front-loaded ahead of the interpretive caveat. Nothing could be trimmed without losing information.

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?

With an output schema present, the description need not explain return values, and the parameter schema is fully documented. The one gap is that it says nothing about where the tool fits relative to the other code-analysis siblings, which the surrounding toolset makes relevant.

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%, with defaults, ranges, and examples already present for path, limit, max_depth, extensions, and ignore_patterns. The description adds no parameter-level detail, so baseline 3 is appropriate.

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 description names a specific verb and resource ('Finds declared symbols that nothing references') and quantifies scope with the 'within the scan' qualifier. It is clearly distinct from siblings like get_code_smells or get_code_inventory, though it never names an alternative explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, and no sibling is named as an alternative. The second sentence explains how to interpret results rather than when to reach for this tool, leaving selection between it and get_code_inventory/get_code_smells to inference.

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