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...
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.
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
Attacks that exploit this kind of access
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.
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.
remove_unused_imports is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
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.
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.
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.
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 →