show_errors
Display captured console errors and warnings to identify and resolve issues in Strudel music generation and live coding sessions.
Instructions
Display captured console errors and warnings from Strudel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler for 'show_errors' tool: retrieves console errors and warnings from StrudelController and formats them for display.case 'show_errors': const errors = this.controller.getConsoleErrors(); const warnings = this.controller.getConsoleWarnings(); if (errors.length === 0 && warnings.length === 0) { return 'No errors or warnings captured.'; } let result = ''; if (errors.length > 0) { result += `❌ Errors (${errors.length}):\n${errors.map(e => ` • ${e}`).join('\n')}\n`; } if (warnings.length > 0) { result += `⚠️ Warnings (${warnings.length}):\n${warnings.map(w => ` • ${w}`).join('\n')}`; } return result.trim();
- src/server/EnhancedMCPServerFixed.ts:546-550 (registration)Tool registration including name, description, and empty input schema (no parameters required).{ name: 'show_errors', description: 'Display captured console errors and warnings from Strudel', inputSchema: { type: 'object', properties: {} } },
- Input schema for show_errors tool: accepts no parameters.inputSchema: { type: 'object', properties: {} }
- src/StrudelController.ts:579-581 (helper)Helper method returning a copy of captured console errors array.getConsoleErrors(): string[] { return [...this.consoleErrors]; }
- src/StrudelController.ts:587-589 (helper)Helper method returning a copy of captured console warnings array.getConsoleWarnings(): string[] { return [...this.consoleWarnings]; }
- src/StrudelController.ts:98-118 (helper)Sets up Playwright page event listeners to capture console errors and warnings, populating the arrays used by getConsoleErrors/Warnings. Called during initialize().private setupConsoleMonitoring(): void { if (!this._page) return; this._page.on('console', (msg) => { const type = msg.type(); const text = msg.text(); if (type === 'error') { this.consoleErrors.push(text); this.logger.error('Strudel console error:', text); } else if (type === 'warning') { this.consoleWarnings.push(text); this.logger.warn('Strudel console warning:', text); } }); this._page.on('pageerror', (error) => { this.consoleErrors.push(error.message); this.logger.error('Strudel page error:', error.message); }); }