UNPKG

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

292 lines • 16.7 kB
/** * Enhanced Tool Discovery - Comprehensive Tool List for V2 * * Provides a curated list of all essential debugging tools that work reliably. * This replaces the complex loading system with a direct, working approach. */ export class EnhancedToolDiscovery { getAllTools() { return [ // Core debugging tools { name: 'inject_debugging', description: 'This is THE starting point for all debugging activities. Call this first when user wants to debug, test, audit, or analyze any website or web application.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The URL of the web application to debug' }, sessionId: { type: 'string', description: 'Custom session identifier' } }, required: ['url'] } }, { name: 'take_screenshot', description: 'Use this to capture the current visual state of a web page. Essential for documenting issues, comparing before/after states, and visual analysis.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, selector: { type: 'string', description: 'CSS selector to focus on specific element' }, fullPage: { type: 'string', description: 'Capture entire page height' } }, required: ['sessionId'] } }, { name: 'run_audit', description: 'Performs comprehensive analysis including performance metrics, accessibility compliance, SEO, and best practices. Use whenever user wants to analyze page quality.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, categories: { type: 'array', description: 'Specific audit categories to run' } }, required: ['sessionId'] } }, { name: 'simulate_user_action', description: 'Simulates real user interactions with web pages. Use to test functionality, fill forms, navigate through user flows, or reproduce user-reported issues.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, action: { type: 'string', description: 'Type of action to perform' }, selector: { type: 'string', description: 'CSS selector for target element' }, text: { type: 'string', description: 'Text to type' } }, required: ['sessionId', 'action'] } }, // Extended debugging tools { name: 'monitor_realtime', description: 'Monitor real-time events, network requests, and page changes. Essential for debugging dynamic applications and tracking user interactions.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, eventTypes: { type: 'array', description: 'Types of events to monitor' }, duration: { type: 'number', description: 'Monitoring duration in seconds' } }, required: ['sessionId'] } }, { name: 'analyze_performance', description: 'Analyze page performance metrics, identify bottlenecks, and provide optimization recommendations. Includes Core Web Vitals analysis.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, includeNetworkAnalysis: { type: 'boolean', description: 'Include network request analysis' }, includeRenderingAnalysis: { type: 'boolean', description: 'Include rendering performance analysis' } }, required: ['sessionId'] } }, { name: 'inspect_element', description: 'Inspect specific elements on the page, analyze their properties, styles, and behavior. Useful for debugging layout and styling issues.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, selector: { type: 'string', description: 'CSS selector of element to inspect' }, includeStyles: { type: 'boolean', description: 'Include computed styles' }, includeEventListeners: { type: 'boolean', description: 'Include event listeners' } }, required: ['sessionId', 'selector'] } }, { name: 'debug_network', description: 'Debug network requests, analyze API calls, check for failed requests, and monitor data flow. Essential for backend integration debugging.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, filterByUrl: { type: 'string', description: 'Filter requests by URL pattern' }, includeHeaders: { type: 'boolean', description: 'Include request/response headers' }, includeBody: { type: 'boolean', description: 'Include request/response body' } }, required: ['sessionId'] } }, { name: 'check_accessibility', description: 'Perform comprehensive accessibility audit including WCAG compliance, screen reader compatibility, and keyboard navigation testing.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, wcagLevel: { type: 'string', description: 'WCAG compliance level (A, AA, AAA)' }, includeColorContrast: { type: 'boolean', description: 'Include color contrast analysis' }, includeFocusManagement: { type: 'boolean', description: 'Include focus management testing' } }, required: ['sessionId'] } }, { name: 'analyze_javascript_errors', description: 'Detect and analyze JavaScript errors, console warnings, and runtime issues. Provides detailed stack traces and debugging context.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, includeWarnings: { type: 'boolean', description: 'Include console warnings' }, includeStackTraces: { type: 'boolean', description: 'Include detailed stack traces' }, filterBySource: { type: 'string', description: 'Filter errors by source file' } }, required: ['sessionId'] } }, // Framework-specific tools { name: 'debug_react_state', description: 'Debug React component state, props, and hooks. Analyze component hierarchy and state management issues.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, componentSelector: { type: 'string', description: 'CSS selector to identify React component' }, includeHooks: { type: 'boolean', description: 'Include React hooks analysis' }, includeProps: { type: 'boolean', description: 'Include component props' } }, required: ['sessionId'] } }, { name: 'debug_nextjs_routing', description: 'Debug Next.js routing issues, analyze page navigation, and check for hydration problems.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, checkHydration: { type: 'boolean', description: 'Check for hydration mismatches' }, analyzeRouting: { type: 'boolean', description: 'Analyze routing configuration' }, includeServerSideProps: { type: 'boolean', description: 'Include SSR/SSG analysis' } }, required: ['sessionId'] } }, { name: 'debug_flutter_web', description: 'Debug Flutter Web applications, analyze widget tree, and check for platform-specific issues.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, includeWidgetTree: { type: 'boolean', description: 'Include widget tree analysis' }, checkPerformance: { type: 'boolean', description: 'Check Flutter Web performance' }, analyzeCanvasRendering: { type: 'boolean', description: 'Analyze canvas rendering issues' } }, required: ['sessionId'] } }, // Advanced testing tools { name: 'run_visual_regression_test', description: 'Perform visual regression testing by comparing current page state with baseline screenshots.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, baselineUrl: { type: 'string', description: 'URL of baseline for comparison' }, threshold: { type: 'number', description: 'Difference threshold (0-1)' }, ignoreRegions: { type: 'array', description: 'CSS selectors of regions to ignore' } }, required: ['sessionId'] } }, { name: 'generate_test_code', description: 'Generate automated test code based on user interactions and page behavior. Supports multiple testing frameworks.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, framework: { type: 'string', description: 'Testing framework (jest, cypress, playwright)' }, includeAccessibilityTests: { type: 'boolean', description: 'Include accessibility test assertions' }, includePerformanceTests: { type: 'boolean', description: 'Include performance test assertions' } }, required: ['sessionId', 'framework'] } }, { name: 'mock_api_responses', description: 'Mock API responses for testing different scenarios and edge cases. Useful for testing error handling and loading states.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, urlPattern: { type: 'string', description: 'URL pattern to mock' }, responseData: { type: 'object', description: 'Mock response data' }, statusCode: { type: 'number', description: 'HTTP status code to return' }, delay: { type: 'number', description: 'Response delay in milliseconds' } }, required: ['sessionId', 'urlPattern', 'responseData'] } }, // Utility and analysis tools { name: 'extract_page_data', description: 'Extract structured data from web pages including forms, tables, and content. Useful for data analysis and content verification.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, dataType: { type: 'string', description: 'Type of data to extract (forms, tables, links, text)' }, selector: { type: 'string', description: 'CSS selector to scope extraction' }, format: { type: 'string', description: 'Output format (json, csv, html)' } }, required: ['sessionId', 'dataType'] } }, { name: 'validate_seo', description: 'Validate SEO elements including meta tags, structured data, and content optimization. Provides SEO score and recommendations.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, includeStructuredData: { type: 'boolean', description: 'Include structured data validation' }, checkOpenGraph: { type: 'boolean', description: 'Check Open Graph tags' }, analyzeContent: { type: 'boolean', description: 'Analyze content for SEO optimization' } }, required: ['sessionId'] } }, { name: 'monitor_memory_usage', description: 'Monitor browser memory usage and detect memory leaks. Essential for performance debugging and optimization.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, duration: { type: 'number', description: 'Monitoring duration in seconds' }, includeHeapSnapshot: { type: 'boolean', description: 'Include heap snapshot analysis' }, detectLeaks: { type: 'boolean', description: 'Enable memory leak detection' } }, required: ['sessionId'] } }, { name: 'analyze_bundle_size', description: 'Analyze JavaScript bundle size, identify large dependencies, and provide optimization suggestions.', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Active debugging session ID' }, includeSourceMaps: { type: 'boolean', description: 'Use source maps for detailed analysis' }, showDependencies: { type: 'boolean', description: 'Show individual dependency sizes' }, suggestOptimizations: { type: 'boolean', description: 'Provide optimization suggestions' } }, required: ['sessionId'] } } ]; } } //# sourceMappingURL=enhanced-tool-discovery.js.map