Skip to main content
Glama
cloudflare

Cloudflare Playwright MCP

Official
by cloudflare

browser_network_requests

Capture and analyze all network requests made by a web page after loading using automated browser testing, integrated with Cloudflare Workers for efficient performance monitoring.

Instructions

Returns all network requests since loading the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function executes the tool logic: retrieves all network requests from the current browser tab, renders them into a log string using the renderRequest helper, and returns an action that displays the log as text content.
    handle: async context => { const requests = context.currentTabOrDie().requests(); const log = [...requests.entries()].map(([request, response]) => renderRequest(request, response)).join('\n'); return { code: [`// <internal code to list network requests>`], action: async () => { return { content: [{ type: 'text', text: log }] }; }, captureSnapshot: false, waitForNetwork: false, }; },
  • Schema definition for the tool, including name, title, description, empty Zod input schema, and readOnly type.
    schema: { name: 'browser_network_requests', title: 'List network requests', description: 'Returns all network requests since loading the page', inputSchema: z.object({}), type: 'readOnly', },
  • src/tools.ts:35-50 (registration)
    Registration of the network tool (via ...network spread) into the snapshotTools array, which includes the browser_network_requests tool.
    export const snapshotTools: Tool<any>[] = [ ...common(true), ...console, ...dialogs(true), ...files(true), ...install, ...keyboard(true), ...navigate(true), ...network, ...pdf, ...screenshot, ...snapshot, ...tabs(true), ...testing, ...wait(true), ];
  • src/tools.ts:52-66 (registration)
    Registration of the network tool (via ...network spread) into the visionTools array, which includes the browser_network_requests tool.
    export const visionTools: Tool<any>[] = [ ...common(false), ...console, ...dialogs(false), ...files(false), ...install, ...keyboard(false), ...navigate(false), ...network, ...pdf, ...tabs(false), ...testing, ...vision, ...wait(false), ];
  • Helper function that formats a network request (and optional response) into a readable string.
    function renderRequest(request: playwright.Request, response: playwright.Response | null) { const result: string[] = []; result.push(`[${request.method().toUpperCase()}] ${request.url()}`); if (response) result.push(`=> [${response.status()}] ${response.statusText()}`); return result.join(' '); }

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/cloudflare/playwright-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server