list_network_requests
Retrieve network requests from a Chrome browser page to analyze performance, debug issues, or inspect resources like scripts and images.
Instructions
List all requests for the currently selected page since the last navigation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageSize | No | Maximum number of requests to return. When omitted, returns all requests. | |
| pageIdx | No | Page number to return (0-based). When omitted, returns the first page. | |
| resourceTypes | No | Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests. |
Implementation Reference
- src/tools/network.ts:66-72 (handler)The handler function that sets the response to include network requests for the selected page, applying pagination (pageSize, pageIdx) and resource type filtering.handler: async (request, response) => { response.setIncludeNetworkRequests(true, { pageSize: request.params.pageSize, pageIdx: request.params.pageIdx, resourceTypes: request.params.resourceTypes, }); },
- src/tools/network.ts:42-65 (schema)Zod schema defining optional input parameters for pagination and filtering network requests.schema: { pageSize: z .number() .int() .positive() .optional() .describe( 'Maximum number of requests to return. When omitted, returns all requests.', ), pageIdx: z .number() .int() .min(0) .optional() .describe( 'Page number to return (0-based). When omitted, returns the first page.', ), resourceTypes: z .array(z.enum(FILTERABLE_RESOURCE_TYPES)) .optional() .describe( 'Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests.', ), },
- src/main.ts:307-320 (registration)Collects tool definitions from all tool modules, including networkTools which exports listNetworkRequests, and registers each with the MCP server via registerTool.const tools = [ ...Object.values(consoleTools), ...Object.values(emulationTools), ...Object.values(inputTools), ...Object.values(networkTools), ...Object.values(pagesTools), ...Object.values(performanceTools), ...Object.values(screenshotTools), ...Object.values(scriptTools), ...Object.values(snapshotTools), ]; for (const tool of tools) { registerTool(tool as unknown as ToolDefinition); }
- src/tools/network.ts:13-33 (helper)Defines the array of filterable Puppeteer ResourceType enums used in the schema for resourceTypes parameter.const FILTERABLE_RESOURCE_TYPES: readonly [ResourceType, ...ResourceType[]] = [ 'document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'prefetch', 'eventsource', 'websocket', 'manifest', 'signedexchange', 'ping', 'cspviolationreport', 'preflight', 'fedcm', 'other', ];