getConsoleLogs
Capture and analyze browser console logs to monitor JavaScript errors, debug web applications, and track browser activity through Chrome extension integration.
Instructions
Check our browser logs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- browser-tools-mcp/mcp-server.ts:178-193 (handler)The inline handler function for the 'getConsoleLogs' tool. It uses withServerConnection to fetch console logs from the browser server at /console-logs endpoint, parses the JSON response, and returns it formatted as a text content block.
server.tool("getConsoleLogs", "Check our browser logs", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/console-logs` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], }; }); }); - browser-tools-mcp/mcp-server.ts:178-193 (registration)The registration of the 'getConsoleLogs' MCP tool using server.tool(), including the inline handler.
server.tool("getConsoleLogs", "Check our browser logs", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/console-logs` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], }; }); });