get_console_logs
Retrieve browser console logs captured during web testing sessions to identify JavaScript errors, warnings, and debugging information for quality assurance.
Instructions
Get all console logs captured during the session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/browser.ts:44-48 (handler)Implements the core logic for retrieving captured console logs from the browser session.async getConsoleLogs() { return this.consoleLogs.length > 0 ? this.consoleLogs.join('\n') : 'No console logs captured.'; }
- src/index.ts:95-102 (schema)Defines the tool schema with name, description, and empty input schema (no parameters required).{ name: "get_console_logs", description: "Get all console logs captured during the session", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:142-144 (registration)Registers the tool handler by dispatching to browserManager.getConsoleLogs() in the tool call switch statement.case "get_console_logs": result = await browserManager.getConsoleLogs(); break;
- src/browser.ts:22-26 (helper)Sets up Puppeteer page event listener to capture console messages into the logs array used by getConsoleLogs.this.page.on('console', msg => { const type = msg.type().toUpperCase(); const text = msg.text(); this.consoleLogs.push(`[${type}] ${text}`); });