Skip to main content
Glama

wipeLogs

Clear all browser logs from memory to ensure data privacy and optimize performance. Part of the BrowserTools MCP for monitoring and interacting with browser activities.

Instructions

Wipe all browser logs from memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server tool registration and handler for 'wipeLogs'. Proxies a POST request to the browser server /wipelogs endpoint and returns the response 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 POST endpoint handler for /wipelogs that invokes the clearAllLogs helper function.
    app.post("/wipelogs", (req, res) => { clearAllLogs(); res.json({ status: "ok", message: "All logs cleared successfully" }); });
  • Core helper function that clears all in-memory log arrays (consoleLogs, consoleErrors, networkErrors, networkSuccess, allXhr) and resets selectedElement.
    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"); }
  • Global in-memory arrays that store browser console logs, errors, and network logs, which are cleared by wipeLogs.
    const consoleLogs: any[] = []; const consoleErrors: any[] = []; const networkErrors: any[] = []; const networkSuccess: any[] = []; const allXhr: any[] = [];

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oenius/browser-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server