Skip to main content
Glama
cloudflare

Cloudflare Playwright MCP

Official
by cloudflare

browser_network_requests

Read-only

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(' ');
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, indicating safe, non-destructive, and potentially variable data retrieval. The description adds valuable context by specifying the temporal scope ('since loading the page'), which isn't covered by annotations. It doesn't contradict annotations, as 'Returns' aligns with read-only behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality ('Returns all network requests') and adds necessary qualification ('since loading the page'). There's no wasted wording, and it directly addresses what the tool does without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema) and rich annotations, the description is adequate but minimal. It explains what data is returned and the scope, but for a tool with openWorldHint=true, it could benefit from clarifying variability (e.g., format of returned requests, potential for empty results). Without an output schema, more detail on return values would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to explain parameters, and it appropriately doesn't mention any. It focuses on the tool's purpose and scope, which is sufficient given the empty input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('all network requests') with a temporal scope ('since loading the page'). It distinguishes this read-only data retrieval tool from siblings that perform browser interactions (click, navigate, type, etc.), though it doesn't explicitly name alternatives for network request analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'since loading the page,' suggesting it's for monitoring network activity during a browser session. However, it doesn't provide explicit guidance on when to use this versus other tools (e.g., for debugging vs. performance analysis) or mention prerequisites like needing an active browser page.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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