wipeLogs
Remove all browser logs from memory to clear sensitive data and maintain privacy. Integrated with the BrowserTools MCP for streamlined browser monitoring and data management.
Instructions
Wipe all browser logs from memory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- browser-tools-mcp/mcp-server.ts:322-340 (registration)MCP tool registration and handler for 'wipeLogs'. Proxies the request to the browser server's /wipelogs HTTP endpoint, which clears all in-memory logs and returns the success message.server.tool("wipeLogs", "Wipe all browser logs from memory", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/wipelogs`, { method: "POST", } ); const json = await response.json(); return { content: [ { type: "text", text: json.message, }, ], }; }); });
- HTTP endpoint handler for POST /wipelogs and the clearAllLogs helper function that wipes all in-memory log arrays (consoleLogs, consoleErrors, networkErrors, networkSuccess, allXhr, selectedElement). This is the core logic executed by the MCP tool.function clearAllLogs() { console.log("Wiping all logs..."); consoleLogs.length = 0; consoleErrors.length = 0; networkErrors.length = 0; networkSuccess.length = 0; allXhr.length = 0; selectedElement = null; console.log("All logs have been wiped"); } // Add endpoint to wipe logs app.post("/wipelogs", (req, res) => { clearAllLogs(); res.json({ status: "ok", message: "All logs cleared successfully" }); });