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
284 lines • 12.4 kB
JavaScript
/**
* MCP Tool Definitions for Orchestrators
*
* These are the ONLY tools exposed to the main LLM.
* All 279 existing tools are hidden behind these orchestrators.
*/
export const ORCHESTRATOR_TOOLS = [
{
name: 'debug_orchestrator',
description: `Orchestrate debugging across your entire application. I'll analyze the issue and coordinate specialized agents to diagnose problems in frontend, backend, database, or infrastructure.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Describe what you want to debug (e.g., "app is slow", "getting 404 errors", "UI looks broken")'
},
url: {
type: 'string',
description: 'Optional: URL of the application to debug'
},
context: {
type: 'object',
description: 'Optional: Additional context about the issue',
properties: {
errorMessage: { type: 'string' },
symptoms: { type: 'array', items: { type: 'string' } },
recentChanges: { type: 'string' },
environment: { type: 'string' }
}
}
},
required: ['task']
}
},
{
name: 'performance_orchestrator',
description: `Analyze and optimize application performance. I'll coordinate agents to profile, measure, and suggest improvements for speed and efficiency.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Describe the performance issue (e.g., "slow page load", "high memory usage", "large bundle size")'
},
url: {
type: 'string',
description: 'URL to analyze'
},
targets: {
type: 'object',
description: 'Optional: Performance targets',
properties: {
loadTime: { type: 'number', description: 'Target load time in ms' },
bundleSize: { type: 'number', description: 'Target bundle size in KB' },
memoryUsage: { type: 'number', description: 'Target memory usage in MB' }
}
}
},
required: ['task']
}
},
{
name: 'test_orchestrator',
description: `Coordinate testing activities. I'll manage test generation, execution, coverage analysis, and regression detection across your application.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Testing task (e.g., "generate tests for login flow", "check test coverage", "run regression tests")'
},
scope: {
type: 'string',
enum: ['unit', 'integration', 'e2e', 'all'],
description: 'Scope of testing'
},
target: {
type: 'string',
description: 'Optional: Specific file, component, or feature to test'
}
},
required: ['task']
}
},
{
name: 'architecture_orchestrator',
description: `Analyze code architecture and quality. I'll coordinate analysis of structure, dependencies, patterns, and suggest improvements.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Architecture task (e.g., "analyze dependencies", "find code smells", "suggest refactoring")'
},
focus: {
type: 'string',
enum: ['structure', 'dependencies', 'patterns', 'quality', 'all'],
description: 'Area to focus on'
},
path: {
type: 'string',
description: 'Optional: Specific path or module to analyze'
}
},
required: ['task']
}
},
{
name: 'fix_orchestrator',
description: `Automatically fix identified issues. I'll coordinate agents to generate and apply fixes for bugs, performance issues, or code quality problems.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'What to fix (e.g., "fix the login bug", "optimize bundle size", "fix linting errors")'
},
issues: {
type: 'array',
items: { type: 'string' },
description: 'Optional: Specific issues to fix (from previous analysis)'
},
autoApply: {
type: 'boolean',
description: 'Whether to automatically apply fixes (default: false)',
default: false
}
},
required: ['task']
}
},
{
name: 'qa_orchestrator',
description: `Comprehensive quality assurance and code review. I'll coordinate agents to check code quality, security, and compliance.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'QA task (e.g., "review security", "check accessibility", "validate best practices")'
},
scope: {
type: 'string',
enum: ['code-review', 'security', 'accessibility', 'performance', 'all'],
description: 'QA focus area',
default: 'all'
}
},
required: ['task']
}
},
{
name: 'hybrid_orchestrator',
description: `Direct control mode with verification capabilities. Use when you need to verify sub-agent claims or get ground truth about system state. Provides access to essential verification tools while still delegating complex workflows.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'What to verify or investigate (e.g., "verify the page actually loads", "check if errors really exist")'
},
verificationTools: {
type: 'array',
items: { type: 'string' },
description: 'Optional: Specific tools to use for verification (e.g., ["take_screenshot", "get_console_logs"])'
},
compareWithSubAgent: {
type: 'boolean',
description: 'Whether to also run sub-agent and compare results (default: true)',
default: true
}
},
required: ['task']
}
},
{
name: 'conversational_orchestrator',
description: `Collaborative dialog mode for complex problem solving. Enables back-and-forth conversation between you and specialized sub-agents to explore problems, brainstorm solutions, and verify understanding before acting.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'Problem to explore through dialog (e.g., "understand why login fails intermittently", "brainstorm performance optimizations")'
},
maxTurns: {
type: 'number',
description: 'Maximum conversation turns (default: 10)',
default: 10
},
agents: {
type: 'array',
items: { type: 'string' },
description: 'Optional: Specific agents to involve in conversation'
}
},
required: ['task']
}
},
{
name: 'verification_first_orchestrator',
description: `Trust but verify mode. Always gathers evidence before accepting claims. Use when you suspect false positives, need high confidence, or previous debugging attempts failed. Returns evidence-based findings with confidence scores.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'What to verify with evidence (e.g., "verify the app is actually working", "confirm there are no errors")'
},
url: {
type: 'string',
description: 'URL to verify'
},
evidenceTypes: {
type: 'array',
items: {
type: 'string',
enum: ['visual', 'console', 'dom', 'network', 'performance', 'all']
},
description: 'Types of evidence to gather (default: all)',
default: ['all']
}
},
required: ['task']
}
}
];
// Hidden sub-agent definitions (not exposed via MCP)
export const SUB_AGENTS = {
// Debug sub-agents
frontend_debug_agent: {
tools: ['inject_debugging', 'take_screenshot', 'get_console_logs', 'simulate_user_action', 'monitor_realtime'],
capabilities: ['dom_inspection', 'event_monitoring', 'state_analysis', 'console_capture']
},
backend_debug_agent: {
tools: ['trace_request', 'inspect_logs', 'analyze_database', 'profile_memory'],
capabilities: ['request_tracing', 'log_analysis', 'query_profiling', 'memory_profiling']
},
error_investigation_agent: {
tools: ['analyze_stack_trace', 'trace_error_origin', 'check_error_patterns', 'suggest_error_fixes'],
capabilities: ['stack_analysis', 'error_correlation', 'root_cause_analysis']
},
// Performance sub-agents
metrics_collection_agent: {
tools: ['collect_performance_metrics', 'measure_core_web_vitals', 'profile_runtime'],
capabilities: ['metric_collection', 'performance_measurement', 'baseline_comparison']
},
optimization_suggestion_agent: {
tools: ['analyze_bundles', 'suggest_code_splitting', 'identify_bottlenecks'],
capabilities: ['bundle_analysis', 'optimization_suggestions', 'performance_recommendations']
},
// Test sub-agents
test_generation_agent: {
tools: ['generate_unit_tests', 'generate_integration_tests', 'generate_e2e_tests'],
capabilities: ['test_generation', 'assertion_creation', 'mock_generation']
},
coverage_analysis_agent: {
tools: ['analyze_test_coverage', 'identify_untested_code', 'suggest_test_improvements'],
capabilities: ['coverage_analysis', 'gap_identification', 'test_recommendations']
}
};
// Routing logic to hide complexity
export function routeToOrchestrator(userInput) {
const input = userInput.toLowerCase();
if (input.includes('debug') || input.includes('error') || input.includes('bug') || input.includes('broken')) {
return 'debug_orchestrator';
}
if (input.includes('slow') || input.includes('performance') || input.includes('optimize')) {
return 'performance_orchestrator';
}
if (input.includes('test') || input.includes('coverage') || input.includes('regression')) {
return 'test_orchestrator';
}
if (input.includes('architecture') || input.includes('structure') || input.includes('quality')) {
return 'architecture_orchestrator';
}
if (input.includes('fix') || input.includes('repair') || input.includes('solve')) {
return 'fix_orchestrator';
}
// Default to debug orchestrator for general issues
return 'debug_orchestrator';
}
//# sourceMappingURL=orchestrator-tools.js.map