Skip to main content
Glama

browser_network_requests

Capture and analyze all network requests initiated after a page loads, enabling detailed monitoring and debugging of web activity within browser automation workflows.

Instructions

Returns all network requests since loading the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the tool: retrieves all network requests from the current browser tab, renders them using renderRequest helper, and returns a structured response with 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 input schema (no parameters), 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) in the snapshotTools array, which aggregates tools for snapshot context.
    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) in the visionTools array, which aggregates tools for vision context.
    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 used by the handler to format individual network request and 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/Angeluis001/playwright-mcp'

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