get_console_errors
Retrieve browser console errors to identify JavaScript issues and debug web applications during automated testing.
Instructions
Get browser console errors
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:783-787 (handler)The handler function that executes the tool logic, returning the stored console errors as a JSON string in the MCP response format.
async getConsoleErrors() { return { content: [{ type: 'text', text: JSON.stringify(consoleErrors, null, 2) }], }; } - index.js:239-246 (registration)Registration of the 'get_console_errors' tool in the ListToolsRequestSchema handler, including name, description, and input schema (empty object).
{ name: 'get_console_errors', description: 'Get browser console errors', inputSchema: { type: 'object', properties: {}, }, }, - index.js:242-245 (schema)Input schema for the get_console_errors tool (no required properties).
inputSchema: { type: 'object', properties: {}, }, - index.js:369-370 (handler)Dispatch case in the central CallToolRequestSchema switch statement that routes to the getConsoleErrors handler.
case 'get_console_errors': return await this.getConsoleErrors(); - index.js:521-528 (helper)Helper code in setupEventListeners that populates the global consoleErrors array from Runtime.consoleAPICalled events.
if (['error', 'warning'].includes(message.params.type)) { consoleErrors.push(logEntry); } // Keep only last 100 entries if (consoleLogs.length > 100) consoleLogs.shift(); if (consoleErrors.length > 100) consoleErrors.shift(); }