find_unused_dependencies
Identify and remove unused dependencies in your project to reduce bloat and improve performance. Analyzes project structure to find unnecessary packages.
Instructions
Find unused dependencies in project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | No | Path to project root |
Implementation Reference
- src/tools/dependency-analysis.ts:124-134 (handler)Handler for 'find_unused_dependencies' tool: calls DependencyAnalyzer.analyzeDependencies with unused check and returns unused dependencies list and count.case 'find_unused_dependencies': { const report = await analyzer.analyzeDependencies(projectPath, { checkUnused: true, checkOutdated: false, checkVulnerabilities: false, }); return { unused: report.unused, total: report.unused.length, }; }
- Schema definition for 'find_unused_dependencies' tool, specifying input parameters like projectPath.{ name: 'find_unused_dependencies', description: 'Find unused dependencies in project', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to project root', }, }, }, },
- src/server.ts:18-25 (registration)Registration of dependencyAnalysisTools (including find_unused_dependencies) into the combined allTools list for MCP server.const allTools = [ ...codeAnalysisTools, ...codeQualityTools, ...dependencyAnalysisTools, ...lintingTools, ...webScrapingTools, ...apiDiscoveryTools, ];
- src/server.ts:66-67 (registration)Dispatch/registration logic in MCP server that routes calls to handleDependencyAnalysisTool for dependency tools including find_unused_dependencies.} else if (dependencyAnalysisTools.some((t) => t.name === name)) { result = await handleDependencyAnalysisTool(name, args || {});
- Core helper method findUnusedDependencies used by the analyzer (placeholder implementation with depcheck integration comments).private async findUnusedDependencies(_projectPath: string): Promise<string[]> { // This is a simplified version. In production, we'd use the depcheck library // For now, return empty array - actual implementation would require depcheck try { // Would use: const { depcheck } = await import('depcheck'); // const result = await depcheck(projectPath, {}); // return result.dependencies || []; return []; } catch { return []; } }