Skip to main content
Glama

remove_dead_code

Destructive

Remove dead code symbols after verifying they are unused. Preview changes with a dry run, then apply to delete. Alerts about orphaned imports.

Instructions

Safely remove a dead symbol from its file. Verifies the symbol is actually dead (multi-signal detection or zero incoming edges) before removal. Warns about orphaned imports in other files. Dry-run by default — preview the plan, then re-call with dry_run: false to apply. Destructive when applied — deletes code from source files. Use get_dead_code first to identify candidates. Returns JSON: { success, removed: { symbol_id, file }, orphanedImports }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbol_idYesSymbol ID to remove (from get_dead_code results)
dry_runNoPreview changes without applying (default: true). Set to false to apply.
Behavior5/5

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

Annotations confirm destructiveHint=true, and the description reinforces this: 'Destructive when applied — deletes code from source files.' It explains safety mechanisms: multi-signal detection for deadness verification and dry-run default. This adds significant value beyond the annotations alone.

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?

Four sentences only, each serving a distinct purpose: main action, verification detail, usage workflow, and data output. Front-loaded with the core purpose. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Without an output schema, the description includes the return JSON structure. It covers safety, workflow, and effects on other files. For a destructive tool with two parameters, this is fully complete and leaves no gaps for an AI agent.

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

Parameters4/5

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

Schema coverage is 100% with both parameters described. The description adds extra context: dry_run defaults to true for preview, and symbol_id comes from get_dead_code results. This enhances the schema's documentation but does not invent new meaning.

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 it removes dead symbols from files. It distinguishes from sibling tool get_dead_code by mentioning it as a prerequisite, establishing a clear workflow. The verb 'remove' is specific to the resource 'dead symbol'.

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

Usage Guidelines5/5

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

The description explicitly provides workflow: dry-run first to preview, then re-call with dry_run: false to apply. It warns about orphaned imports and directs users to use get_dead_code first. No ambiguity about when or when not to use this tool.

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/nikolai-vysotskyi/trace-mcp'

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