Skip to main content
Glama

browser_network_requests

Read-only

Capture all network requests made by a web page after loading to analyze API calls, resource loading, and performance metrics.

Instructions

Returns all network requests since loading the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that retrieves all network requests using tab.requests() and adds rendered results to the response.
    handle: async (tab, params, response) => {
      const requests = tab.requests();
      [...requests.entries()].forEach(([req, res]) => response.addResult(renderRequest(req, res)));
    },
  • Schema definition including name, title, description, input schema (empty object), and readOnly type for the browser_network_requests tool.
      name: 'browser_network_requests',
      title: 'List network requests',
      description: 'Returns all network requests since loading the page',
      inputSchema: z.object({}),
      type: 'readOnly',
    },
  • The tool definition using defineTabTool and export as default array for registration.
    const requests = defineTabTool({
      capability: 'core',
    
      schema: {
        name: 'browser_network_requests',
        title: 'List network requests',
        description: 'Returns all network requests since loading the page',
        inputSchema: z.object({}),
        type: 'readOnly',
      },
    
      handle: async (tab, params, response) => {
        const requests = tab.requests();
        [...requests.entries()].forEach(([req, res]) => response.addResult(renderRequest(req, res)));
      },
    });
    
    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(' ');
    }
    
    export default [
      requests,
    ];
  • Helper function to format 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(' ');
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds useful context by specifying 'since loading the page,' which clarifies the temporal scope of data returned, enhancing behavioral understanding beyond annotations.

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, clear sentence that efficiently conveys the core functionality without any wasted words. It's front-loaded with the main action and resource, 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 (0 parameters, no output schema) and rich annotations, the description is adequate but has gaps. It lacks details on output format (e.g., structure of returned requests) and doesn't address potential limitations like data volume or browser state requirements, making it minimally viable.

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, there's no need for parameter details in the description. The baseline for zero parameters is 4, as the description appropriately focuses on the tool's function without redundant parameter explanations.

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 action ('Returns') and resource ('all network requests since loading the page'), making the purpose understandable. However, it doesn't explicitly differentiate from siblings like browser_console_messages or browser_tab_list, which also retrieve browser data but for different resources.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active browser page), exclusions, or how it relates to siblings like browser_console_messages for different data types, leaving usage context unclear.

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