remove_unused_imports

Automatically remove unused import statements to clean up code. Safely detects which imports are actually used.\n\nExamples:\n• Bundle size optimization: remove_unused_imports() to reduce bundle size\n• Code cleanup: remove_unused_imports() after refactoring\n• Linting compliance: remove_unused_i...

Server Tree-Hugger-JS MCP Server qckfx/tree-hugger-js-mcp
Category Write
Risk class Medium
Parameters 00 required

What remove_unused_imports does on Tree-Hugger-JS MCP Server

AI agents use remove_unused_imports to create or update resources in Tree-Hugger-JS MCP Server — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Tree-Hugger-JS MCP Server environment.

Why remove_unused_imports needs a policy

This tool modifies source files by removing import statements. While it deletes specific lines, imports can be re-added, making this reversible in nature (Write rather than Destructive). However, if applied to files without version control, the changes could be hard to undo, warranting medium severity. The {preview: true} option suggests the default mode makes actual changes to code files.

From the tool's definition 'Automatically remove unused import statements to clean up code' and 'remove_unused_imports() after refactoring' — modifies source code by removing import statements

Questions about remove_unused_imports

What does the remove_unused_imports tool do? +

Automatically remove unused import statements to clean up code. Safely detects which imports are actually used.\n\nExamples:\n• Bundle size optimization: remove_unused_imports() to reduce bundle size\n• Code cleanup: remove_unused_imports() after refactoring\n• Linting compliance: remove_unused_imports() to fix ESLint warnings\n• Before deployment: remove_unused_imports({preview: true}) to see what will be removed\n• Legacy cleanup: remove_unused_imports() after removing old code\n• Development workflow: remove_unused_imports() during feature development. It is categorised as a Write tool in the Tree-Hugger-JS MCP Server MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.

How do I enforce a policy on remove_unused_imports? +

Register the Tree-Hugger-JS MCP Server MCP server in PolicyLayer and add a rule for remove_unused_imports: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Tree-Hugger-JS MCP Server. Nothing to install.

What risk level is remove_unused_imports? +

remove_unused_imports is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit remove_unused_imports? +

Yes. Add a rate_limit block to the remove_unused_imports rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block remove_unused_imports completely? +

Set action: deny in the PolicyLayer policy for remove_unused_imports. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides remove_unused_imports? +

remove_unused_imports is provided by the Tree-Hugger-JS MCP Server MCP server (qckfx/tree-hugger-js-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.