Skip to main content
Glama

sweep_dead_code

Scan for unused imports, functions, and orphan files; delete them safely via transactional edits.

Instructions

Detect dead code: unused imports/functions, orphan files, unused_guard signal. Text-reference fallback counts CLI-string refs as alive (miss-over-delete bias). Remove via edit_transaction. Out of scope: dynamic/reflection wiring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoScan scope: directory relative to workspace_dir (default: ".")
include_filesNoAlso detect orphan files (default: false)
workspace_dirYesREQUIRED: project root (abs).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Even with no annotations, the description discloses the critical behavioral trait: 'Text-reference fallback counts CLI-string refs as alive (miss-over-delete bias)'. This is an honest limitation that helps the agent calibrate expectations. Also clarifies it is detection-only, pointing removal elsewhere, and states an exclusion.

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?

The description is two sentences, front-loaded with the purpose, and every phrase earns its place: categories, bias, removal path, and scope exclusion. No wasted words.

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 tool with no output schema and a moderate parameter set, the description provides sufficient context: what it detects, its detection bias, how to act on results, and what is out of scope. It could mention the return format or signal structure, but that is a minor gap given the clarity of the description and schema.

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 schema already documents all three parameters. The description adds no parameter-specific detail beyond what the schema provides, but it does mention 'unused_guard signal' as an output concept, not a parameter explanation. Baseline 3 is appropriate because the description doesn't need to compensate.

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 description clearly states the tool's purpose: 'Detect dead code' and enumerates specific categories (unused imports/functions, orphan files). This is a specific verb+resource combination that distinguishes it from sibling tools like dep_graph or references.

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?

The description gives clear context for use: detection of dead code with a bias toward false negatives. It explicitly notes out-of-scope cases (dynamic/reflection wiring) and points to edit_transaction for removal. However, it does not explicitly name alternative detection tools or state when to prefer this over dep_graph or references.

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

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/wulun811/LiuHe'

If you have feedback or need assistance with the MCP directory API, please join our Discord server