Skip to main content
Glama

getNetworkErrors

Analyze and retrieve network error logs to identify and resolve connectivity issues in web applications through the Chrome extension on the BrowserTools MCP server.

Instructions

Check our network ERROR logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the 'getNetworkErrors' MCP tool. It uses withServerConnection to fetch network error logs from the browser connector server at /network-errors endpoint and returns the JSON-formatted response with isError: true.
    server.tool("getNetworkErrors", "Check our network ERROR logs", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/network-errors` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], isError: true, }; }); });
  • Registration of the 'getNetworkErrors' tool using server.tool() with description 'Check our network ERROR logs' and inline handler function.
    server.tool("getNetworkErrors", "Check our network ERROR logs", async () => { return await withServerConnection(async () => { const response = await fetch( `http://${discoveredHost}:${discoveredPort}/network-errors` ); const json = await response.json(); return { content: [ { type: "text", text: JSON.stringify(json, null, 2), }, ], isError: true, }; }); });
  • Helper function 'withServerConnection' that wraps API calls to ensure server discovery and handles reconnection attempts. Used by the getNetworkErrors handler and other tools.
    async function withServerConnection<T>( apiCall: () => Promise<T> ): Promise<T | any> { // Attempt to discover server if not already discovered if (!serverDiscovered) { const discovered = await discoverServer(); if (!discovered) { return { content: [ { type: "text", text: "Failed to discover browser connector server. Please ensure it's running.", }, ], isError: true, }; } } // Now make the actual API call with discovered host/port try { return await apiCall(); } catch (error: any) { // If the request fails, try rediscovering the server once console.error( `API call failed: ${error.message}. Attempting rediscovery...` ); serverDiscovered = false; if (await discoverServer()) { console.error("Rediscovery successful. Retrying API call..."); try { // Retry the API call with the newly discovered connection return await apiCall(); } catch (retryError: any) { console.error(`Retry failed: ${retryError.message}`); return { content: [ { type: "text", text: `Error after reconnection attempt: ${retryError.message}`, }, ], isError: true, }; } } else { console.error("Rediscovery failed. Could not reconnect to server."); return { content: [ { type: "text", text: `Failed to reconnect to server: ${error.message}`, }, ], isError: true, }; } } }

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