Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_network_requests

Read-only

Capture and analyze network requests during web page interactions to monitor resource loading, API calls, and performance metrics for debugging and optimization.

Instructions

Returns all network requests since loading the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeStaticNoWhether to include successful static resources like images, fonts, scripts, etc. Defaults to false.

Implementation Reference

  • The main handler function for the 'browser_network_requests' tool, which fetches network requests from the current browser tab, formats them using renderRequest, and returns a text log via an action.
    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 'browser_network_requests' tool, including name, title, description, empty 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',
    },
  • Exports the defined 'browser_network_requests' tool (as 'requests') for inclusion in the main tools arrays.
    export default [
      requests,
    ];
  • Helper function used by the handler to format each network request and optional response into a concise 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(' ');
    }
  • src/tools.ts:35-50 (registration)
    Includes the network tools (containing 'browser_network_requests') in the snapshotTools array via spread of the network module.
    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),
    ];
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds value by specifying 'since loading the page', indicating temporal scope, but doesn't disclose behavioral traits like rate limits, pagination, or response format. With annotations providing core safety, a 3 is appropriate for minimal added context.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, with every part contributing essential information, making it highly concise and well-structured.

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 low complexity (1 parameter, 100% schema coverage, no output schema) and rich annotations, the description is minimally adequate. It covers the basic action but lacks details on output format, error handling, or integration with siblings, leaving gaps despite structured data support.

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

Parameters3/5

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

Schema description coverage is 100%, with the parameter 'includeStatic' fully documented in the schema. The description adds no parameter-specific information beyond what the schema provides, such as examples or edge cases. Baseline 3 is correct as the schema handles parameter documentation adequately.

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 since loading the page', providing specific functionality. However, it doesn't explicitly differentiate from sibling tools like browser_console_messages or browser_snapshot that might also capture network-related data, missing full sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as browser_console_messages for console logs or browser_snapshot for visual captures. It lacks explicit context, prerequisites, or exclusions, offering only a basic functional statement without usage direction.

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

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

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