Skip to main content
Glama

browser_network_requests

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

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