Skip to main content
Glama

cleanse

Remove unused imports and dead variables from JavaScript/TypeScript projects after scanning for dead code. Skips risky elements like functions and exports.

Instructions

Safely removes dead code found by scan_dead_code. Auto-removes unused imports and side-effect-free variables. Skips anything risky (functions, exports, initializers with side effects). Always run scan_dead_code first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_rootYesAbsolute path to the project root directory
dry_runNoIf true, shows what would be removed without modifying files.
Behavior4/5

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

With no annotations, the description fully discloses behavior: it auto-removes unused imports and side-effect-free variables, and skips functions, exports, and initializers with side effects. It also mentions the dry_run parameter for preview. This provides a clear understanding of what the tool does and does not modify.

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 three concise sentences. The first sentence states the core functionality, the second provides specifics on what is removed and skipped, and the third gives a prerequisite. Every sentence is meaningful and contributes to understanding.

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?

Given the absence of an output schema and annotations, the description is reasonably complete. It covers the tool's purpose, precondition (run scan_dead_code first), safe removal behavior, and dry_run option. It does not explain return values or success confirmation, but for a cleanup tool, the behavior is well-specified.

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 coverage is 100%, so the schema already describes both parameters adequately. The description adds no further parameter-level details beyond what is in the schema, resulting in a baseline score of 3.

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 verb 'removes dead code' and the resource (dead code found by scan_dead_code). It implicitly distinguishes from the sibling 'scan_dead_code' by specifying that this tool cleanses while the other scans.

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 provides explicit usage guidance: 'Always run `scan_dead_code` first.' It also indicates what the tool skips (risky elements), helping the agent decide when to use it. However, it does not explicitly state when not to use it or list alternatives beyond the prerequisite.

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

Install Server

Other Tools

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/Parth3930/clenzer'

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