diagnostics
Retrieve browser diagnostics to identify cache issues, errors, and performance metrics for troubleshooting Strudel.cc music coding sessions.
Instructions
Get detailed browser diagnostics including cache, errors, and performance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/StrudelController.ts:718-745 (handler)Primary implementation of the diagnostics tool: collects browser connection status, page load status, editor readiness, audio connection, cache info, and error statistics via Puppeteer page evaluations.async getDiagnostics(): Promise<BrowserDiagnostics> { const diagnostics: BrowserDiagnostics = { browserConnected: this.browser !== null, pageLoaded: this._page !== null, editorReady: false, audioConnected: false, cacheStatus: { hasCache: this.editorCache.length > 0, cacheAge: this.cacheTimestamp > 0 ? Date.now() - this.cacheTimestamp : 0 }, errorStats: this.errorRecovery.getErrorStats() }; if (this._page) { try { diagnostics.editorReady = await this._page.evaluate(() => { return document.querySelector('.cm-content') !== null; }); diagnostics.audioConnected = await this._page.evaluate(() => { return (window as any).strudelAudioAnalyzer?.isConnected || false; }); } catch (error) { this.logger.warn('Failed to get diagnostics', error); } } return diagnostics;
- src/server/EnhancedMCPServerFixed.ts:541-545 (registration)Tool registration definition in the getTools() array, specifying name, description, and empty input schema for MCP tool listing.{ name: 'diagnostics', description: 'Get detailed browser diagnostics including cache, errors, and performance', inputSchema: { type: 'object', properties: {} } },
- MCP tool dispatcher in executeTool switch statement: handles 'diagnostics' calls, checks browser initialization, and delegates to StrudelController.getDiagnostics().case 'diagnostics': if (!this.isInitialized) { return { initialized: false, message: 'Browser not initialized. Run init first for full diagnostics.' }; } return await this.controller.getDiagnostics();
- src/types/AudioAnalysis.ts:86-96 (schema)TypeScript interface defining the structure of BrowserDiagnostics returned by the diagnostics tool.export interface BrowserDiagnostics { browserConnected: boolean; pageLoaded: boolean; editorReady: boolean; audioConnected: boolean; cacheStatus: { hasCache: boolean; cacheAge: number; }; errorStats: Record<string, ErrorStats>; }