Skip to main content
Glama

browser_network_requests

Capture and retrieve all network requests made after loading a webpage using Playwright MCP, enabling detailed analysis and monitoring of web interactions.

Instructions

Returns all network requests since loading the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'browser_network_requests' tool. It retrieves all network requests from the current tab using tab.requests() and adds rendered results to the response using the renderRequest helper.
    handle: async (tab, params, response) => { const requests = tab.requests(); [...requests.entries()].forEach(([req, res]) => response.addResult(renderRequest(req, res))); },
  • The schema definition for the tool, including name, title, description, empty input schema (no params needed), 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', },
  • Helper function to render a single network request (method, url, status) into a string for the response.
    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(' '); }
  • Exports the defined tool for inclusion in the central tools list.
    export default [ requests, ];
  • src/tools.ts:36-52 (registration)
    Central registration of all tools, including the network tools containing 'browser_network_requests', into the allTools array used by BrowserServerBackend.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];

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

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