/**
* MCP TOOL REGISTRY UPDATE
* Registers File Hygiene Tools with MCP Server
*/
const FileHygieneTools = require('./file-hygiene-tools');
const FileHygieneAgent = require('../agents/file-hygiene-agent');
// Tool definitions for MCP
const FILE_HYGIENE_TOOLS = {
checkHealth: {
name: 'file_hygiene_check_health',
description: 'Check file system health and broken dependencies',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.checkHealth();
}
},
startMonitoring: {
name: 'file_hygiene_start_monitoring',
description: 'Start continuous file system monitoring',
parameters: {
interval: {
type: 'number',
description: 'Check interval in minutes',
default: 60
}
},
handler: async (params) => {
const tools = new FileHygieneTools();
return await tools.startMonitoring(params.interval);
}
},
rebuildInventory: {
name: 'file_hygiene_rebuild_inventory',
description: 'Rebuild the complete file inventory',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.rebuildInventory();
}
},
remapDependencies: {
name: 'file_hygiene_remap_dependencies',
description: 'Remap all code dependencies',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.remapDependencies();
}
},
testReorganization: {
name: 'file_hygiene_test_reorganization',
description: 'Test safe file reorganization (dry run)',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.testReorganization();
}
},
getBrokenDependencies: {
name: 'file_hygiene_get_broken_dependencies',
description: 'Get list of broken file dependencies',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.getBrokenDependencies();
}
},
getInventorySummary: {
name: 'file_hygiene_get_inventory_summary',
description: 'Get summary of file inventory',
parameters: {},
handler: async () => {
const tools = new FileHygieneTools();
return await tools.getInventorySummary();
}
}
};
// Agent definition for MCP
const FILE_HYGIENE_AGENT = {
name: 'FileHygieneAgent',
description: 'Agent for file system health monitoring and maintenance',
capabilities: [
'health_check',
'continuous_monitoring',
'dependency_analysis',
'reorganization_planning',
'inventory_management',
'alert_generation'
],
commands: {
health_check: {
description: 'Perform comprehensive health check',
parameters: {}
},
start_monitoring: {
description: 'Start continuous monitoring',
parameters: {
interval: {
type: 'number',
description: 'Check interval in minutes',
default: 60
}
}
},
analyze_reorganization: {
description: 'Analyze safe reorganization options',
parameters: {}
},
rebuild_system: {
description: 'Rebuild inventory and dependencies',
parameters: {}
},
get_broken_dependencies: {
description: 'Get broken dependencies list',
parameters: {}
},
get_inventory_summary: {
description: 'Get inventory summary',
parameters: {}
},
status: {
description: 'Get agent status',
parameters: {}
}
},
handler: async (command, params) => {
const agent = new FileHygieneAgent();
await agent.initialize();
return await agent.execute(command, params);
}
};
// Export for MCP registration
module.exports = {
tools: FILE_HYGIENE_TOOLS,
agent: FILE_HYGIENE_AGENT,
// Registration function
register: (mcpServer) => {
console.log('[MCP] Registering File Hygiene Tools...');
// Register each tool
for (const [key, tool] of Object.entries(FILE_HYGIENE_TOOLS)) {
mcpServer.registerTool(tool);
console.log(` ✓ Registered tool: ${tool.name}`);
}
// Register agent
mcpServer.registerAgent(FILE_HYGIENE_AGENT);
console.log(` ✓ Registered agent: ${FILE_HYGIENE_AGENT.name}`);
console.log('[MCP] File Hygiene Tools registration complete');
}
};