getConsoleErrors
Retrieve browser console errors to identify and debug JavaScript issues during web development and testing.
Instructions
Check our browsers console errors
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "getConsoleErrors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- browser-tools-mcp/mcp-server.ts:195-214 (handler)The handler function for the getConsoleErrors tool. It connects to the browser server and fetches console errors from the /console-errors endpoint, then formats and returns the JSON response as text content.
server.tool( "getConsoleErrors", "Check our browsers console errors", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/console-errors` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], }; }); } ); - browser-tools-mcp/mcp-server.ts:195-214 (registration)Registers the getConsoleErrors tool on the MCP server with description 'Check our browsers console errors'. The handler is inline.
server.tool( "getConsoleErrors", "Check our browsers console errors", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/console-errors` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], }; }); } );