Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

get_network_logs

Retrieve network request and response logs from browser debugging sessions, with optional filtering by URL, method, status code, or resource type.

Instructions

Get network request/response logs collected since the debugger was attached. Optionally filter by URL pattern, method, status code, or resource type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter criteria for network logs
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication

Implementation Reference

  • Input schema (Zod) for the 'get_network_logs' tool: defines optional filters (urlPattern, method, statusCode, resourceType), tabId, and apiKey.
    {
      filter: z.object({
        urlPattern: z.string().optional().describe('Filter by URL substring or pattern'),
        method: z.string().optional().describe('Filter by HTTP method (GET, POST, etc.)'),
        statusCode: z.number().optional().describe('Filter by response status code'),
        resourceType: z.string().optional().describe('Filter by resource type (Document, Script, Stylesheet, Image, XHR, Fetch, etc.)'),
      }).optional().describe('Filter criteria for network logs'),
      tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
      apiKey: z.string().optional().describe('API key for authentication'),
    },
  • Handler function for 'get_network_logs': sends the command via WebSocketBridge and returns the result as JSON.
      async ({ filter, tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'get_network_logs',
          params: { filter },
          tabId,
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • Registration of 'get_network_logs' tool via server.tool() within registerDevtoolsNetworkTools, which is called from tools/index.ts.
    export function registerDevtoolsNetworkTools(server: McpServer, bridge: WebSocketBridge) {
      server.tool(
        'get_network_logs',
        'Get network request/response logs collected since the debugger was attached. Optionally filter by URL pattern, method, status code, or resource type.',
        {
          filter: z.object({
            urlPattern: z.string().optional().describe('Filter by URL substring or pattern'),
            method: z.string().optional().describe('Filter by HTTP method (GET, POST, etc.)'),
            statusCode: z.number().optional().describe('Filter by response status code'),
            resourceType: z.string().optional().describe('Filter by resource type (Document, Script, Stylesheet, Image, XHR, Fetch, etc.)'),
          }).optional().describe('Filter criteria for network logs'),
          tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
          apiKey: z.string().optional().describe('API key for authentication'),
        },
        async ({ filter, tabId, apiKey }) => {
          const result = await bridge.sendCommand({
            command: 'get_network_logs',
            params: { filter },
            tabId,
            apiKey,
          });
          if (!result.success) {
            return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
          }
          return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
        }
      );
  • registerAllTools calls registerDevtoolsNetworkTools, which registers the 'get_network_logs' tool.
    export function registerAllTools(server: McpServer, bridge: WebSocketBridge) {
      registerNavigationTools(server, bridge);
      registerTabManagementTools(server, bridge);
      registerKeyboardTools(server, bridge);
      registerScreenshotTools(server, bridge);
      registerClickTools(server, bridge);
      registerInputTools(server, bridge);
      registerDragDropTools(server, bridge);
      registerHoverTools(server, bridge);
    
      registerDevtoolsSourcesTools(server, bridge);
      registerDevtoolsModifyTools(server, bridge);
      registerDevtoolsNetworkTools(server, bridge);
      registerDevtoolsStorageTools(server, bridge);
      registerDevtoolsConsoleTools(server, bridge);
    
      registerAccessibilityTools(server, bridge);
      registerEmulationTools(server, bridge);
      registerElementTools(server, bridge);
      registerAuditTools(server, bridge);
      registerInteractionTools(server, bridge);
      registerMonitoringTools(server, bridge);
      registerQaTools(server, bridge);
      registerGestureTools(server, bridge);
      registerMacroTools(server, bridge);
      registerVisualRegressionTools(server, bridge);
    }
Behavior3/5

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

With no annotations, the description carries the full burden. It notes logs are collected since attachment, a key behavioral detail, but omits potential side effects (e.g., logs preserved across calls?), permissions, or limitations. Adequate but minimal.

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?

Two sentences with no waste. The first sentence conveys the core action and scope, the second lists key filter options. Information is front-loaded and efficiently packaged.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides enough context for a retrieval tool: sources (logs since attached) and filtering options. Missing output format details, but siblings like get_network_errors also lack output schemas, suggesting a consistent pattern. Slightly incomplete for a new agent.

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 coverage is 100% with clear parameter descriptions. The description mentions filter fields (URL pattern, method, status code, resource type), which maps to the filter object, but adds no new meaning beyond what the schema already provides. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves network request/response logs collected since the debugger attached, with optional filters. It distinguishes from siblings like get_network_errors (errors only) and get_network_request_detail (single request detail).

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

Usage Guidelines3/5

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

The description implies usage for debugging network activity but does not explicitly state when to use this tool versus alternatives like get_network_errors or clear_network_logs. No exclusion criteria or context provided.

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/BrowserGenie/mcp'

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