pilot_network
Retrieve network request data from a circular buffer to monitor and analyze web traffic during browser automation tasks.
Instructions
Get network requests from the circular buffer.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Clear the buffer after reading |
Implementation Reference
- src/tools/inspection.ts:55-68 (handler)The 'pilot_network' tool definition and handler implementation which retrieves network requests from a circular buffer.
server.tool( 'pilot_network', 'Get network requests from the circular buffer.', { clear: z.boolean().optional().describe('Clear the buffer after reading') }, async ({ clear }) => { await bm.ensureBrowser(); if (clear) { networkBuffer.clear(); return { content: [{ type: 'text' as const, text: 'Network buffer cleared.' }] }; } if (networkBuffer.length === 0) return { content: [{ type: 'text' as const, text: '(no network requests)' }] }; const text = networkBuffer.toArray().map(e => `${e.method} ${e.url} → ${e.status || 'pending'} (${e.duration || '?'}ms, ${e.size || '?'}B)` ).join('\n'); return { content: [{ type: 'text' as const, text }] }; } );