get_network_logs
Retrieve network activity logs for debugging and monitoring web requests during browser automation and testing on ARM64 devices.
Instructions
Get network activity logs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:248-254 (registration)Registration of the 'get_network_logs' tool in the ListTools response, including name, description, and empty input schema.name: 'get_network_logs', description: 'Get network activity logs', inputSchema: { type: 'object', properties: {}, }, },
- index.js:371-372 (handler)Dispatch handler in CallToolRequestSchema that calls the getNetworkLogs method.case 'get_network_logs': return await this.getNetworkLogs();
- index.js:789-793 (handler)The core handler function that returns the stored network logs as a JSON string in the MCP response format.async getNetworkLogs() { return { content: [{ type: 'text', text: JSON.stringify(networkLogs, null, 2) }], }; }
- index.js:530-548 (helper)Helper code in setupEventListeners that captures and stores network logs from CDP Network.responseReceived events into the global networkLogs array.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(); }