ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
127 lines • 4.38 kB
JavaScript
/**
* Tool alias mapping for AI-friendly tool discovery
* Maps common tool name variations to canonical tool names
*/
export const TOOL_ALIASES = {
// Console log variations
'console_logs': 'get_console_logs',
'get_logs': 'get_console_logs',
'console': 'get_console_logs',
'logs': 'get_console_logs',
'get_console': 'get_console_logs',
'read_console_logs': 'get_console_logs',
'fetch_console_logs': 'get_console_logs',
// Network variations
'network': 'get_network_activity',
'get_network': 'get_network_activity',
'network_requests': 'get_network_activity',
'get_network_requests': 'get_network_activity',
'fetch_network_activity': 'get_network_activity',
'read_network_activity': 'get_network_activity',
'get_requests': 'get_network_activity',
// Error variations
'errors': 'get_errors',
'get_error': 'get_errors',
'get_error_logs': 'get_errors',
'get_exceptions': 'get_errors',
'javascript_errors': 'get_errors',
'js_errors': 'get_errors',
// Performance variations
'performance': 'get_performance_metrics',
'get_performance': 'get_performance_metrics',
'performance_data': 'get_performance_metrics',
'get_metrics': 'get_performance_metrics',
'web_vitals': 'get_performance_metrics',
'get_web_vitals': 'get_performance_metrics',
// DOM variations
'dom': 'get_dom_snapshot',
'get_dom': 'get_dom_snapshot',
'dom_tree': 'get_dom_snapshot',
'get_dom_tree': 'get_dom_snapshot',
'html': 'get_dom_snapshot',
'get_html': 'get_dom_snapshot',
// Storage variations
'localstorage': 'get_local_storage',
'storage': 'get_local_storage',
'get_storage': 'get_local_storage',
'local_storage_data': 'get_local_storage',
// Cookie variations
'cookie': 'get_cookies',
'get_cookie': 'get_cookies',
'cookies_data': 'get_cookies',
// Search variations
'search': 'search_logs',
'find': 'search_logs',
'grep': 'search_logs',
'search_debug_data': 'search_logs',
// List variations
'list_debug_data': 'list_available_debug_data',
'available_data': 'list_available_debug_data',
'debug_data_types': 'list_available_debug_data',
// Screenshot variations
'screenshot': 'take_screenshot',
'capture_screenshot': 'take_screenshot',
'get_screenshot': 'take_screenshot',
'screen_capture': 'take_screenshot',
// User action variations
'click': 'simulate_user_action',
'type': 'simulate_user_action',
'user_action': 'simulate_user_action',
'simulate_action': 'simulate_user_action',
// Session variations
'start_session': 'inject_debugging',
'begin_debug': 'inject_debugging',
'start_debugging': 'inject_debugging',
'launch_debug': 'inject_debugging',
'end_session': 'close_session',
'stop_debugging': 'close_session',
'cleanup': 'close_session',
// Report variations
'report': 'get_debug_report',
'debug_report': 'get_debug_report',
'generate_report': 'get_debug_report',
// Monitoring variations
'monitor': 'monitor_realtime',
'realtime_monitor': 'monitor_realtime',
'watch': 'monitor_realtime',
'observe': 'monitor_realtime',
// Audit variations
'audit': 'run_audit',
'quality_check': 'run_audit',
'analyze_quality': 'run_audit',
// Mock variations
'mock': 'mock_network',
'mock_response': 'mock_network',
'stub_network': 'mock_network'
};
/**
* Resolve a tool name to its canonical form
*/
export function resolveToolAlias(toolName) {
// First check if it's already a canonical name
if (Object.values(TOOL_ALIASES).includes(toolName)) {
return toolName;
}
// Check aliases (case-insensitive)
const lowerToolName = toolName.toLowerCase();
for (const [alias, canonical] of Object.entries(TOOL_ALIASES)) {
if (alias.toLowerCase() === lowerToolName) {
return canonical;
}
}
// Return original if no alias found
return toolName;
}
/**
* Get all aliases for a canonical tool name
*/
export function getToolAliases(canonicalName) {
const aliases = [];
for (const [alias, canonical] of Object.entries(TOOL_ALIASES)) {
if (canonical === canonicalName) {
aliases.push(alias);
}
}
return aliases;
}
//# sourceMappingURL=tool-aliases.js.map