get_network_logs
Extract network activity logs for debugging and monitoring web interactions during automated testing with the Chromium ARM64 Browser on devices like Raspberry Pi.
Instructions
Get network activity logs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:789-793 (handler)The main handler function for the 'get_network_logs' tool. It returns the stored network logs array as a formatted JSON string in the MCP tool response format.async getNetworkLogs() { return { content: [{ type: 'text', text: JSON.stringify(networkLogs, null, 2) }], }; }
- index.js:247-254 (registration)Registration of the 'get_network_logs' tool in the ListToolsRequestSchema handler, including name, description, and input schema (empty object).{ name: 'get_network_logs', description: 'Get network activity logs', inputSchema: { type: 'object', properties: {}, }, },
- index.js:371-372 (registration)Dispatcher case in the CallToolRequestSchema switch statement that routes calls to the getNetworkLogs handler method.case 'get_network_logs': return await this.getNetworkLogs();
- index.js:23-23 (helper)Global array that stores the network log entries collected from browser events.let networkErrors = [];
- index.js:530-548 (helper)Supporting code in the WebSocket event listener (setupEventListeners method) that populates the networkLogs array when Network.responseReceived events are received from the browser.if (message.method === 'Network.responseReceived') { const logEntry = { url: message.params.response.url, status: message.params.response.status, statusText: message.params.response.statusText, method: message.params.response.requestMethod || 'GET', timestamp: new Date().toISOString() }; networkLogs.push(logEntry); if (message.params.response.status >= 400) { networkErrors.push(logEntry); } // Keep only last 100 entries if (networkLogs.length > 100) networkLogs.shift(); if (networkErrors.length > 100) networkErrors.shift(); }