Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

clear_network_logs

Clear all network logs collected for a browser tab to reset monitoring or free up memory.

Instructions

Clear all collected network logs for a tab

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNoTarget tab ID (defaults to active tab)
apiKeyNoAPI key for authentication

Implementation Reference

  • The handler function for the 'clear_network_logs' tool. It sends a 'clear_network_logs' command via the WebSocket bridge, with optional tabId and apiKey params, and returns a success message or error.
    server.tool(
      'clear_network_logs',
      'Clear all collected network logs for a tab',
      {
        tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
        apiKey: z.string().optional().describe('API key for authentication'),
      },
      async ({ tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'clear_network_logs',
          params: {},
          tabId,
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: 'Network logs cleared' }] };
      }
    );
  • Input schema for 'clear_network_logs': optional tabId (number) and apiKey (string) parameters.
    {
      tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
      apiKey: z.string().optional().describe('API key for authentication'),
    },
  • Registration of 'clear_network_logs' tool via server.tool(), defined inside registerDevtoolsNetworkTools() function.
    server.tool(
      'clear_network_logs',
      'Clear all collected network logs for a tab',
      {
        tabId: z.number().optional().describe('Target tab ID (defaults to active tab)'),
        apiKey: z.string().optional().describe('API key for authentication'),
      },
      async ({ tabId, apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'clear_network_logs',
          params: {},
          tabId,
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: 'Network logs cleared' }] };
      }
    );
  • registerDevtoolsNetworkTools is called from registerAllTools() in src/tools/index.ts, which wires up all tool registrations.
    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);
Behavior3/5

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

No annotations; description implies destructive action but does not emphasize irreversibility or mention that it clears only for the specified tab. Basic transparency but could be improved.

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?

Single sentence with no unnecessary words; effectively communicates core purpose.

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?

Simple tool with no output schema; description covers action and target. Additional context (e.g., typical use case) would improve completeness but not essential.

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% for both parameters. Description adds minimal value beyond schema; 'for a tab' is already implied by the tabId parameter.

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?

Description clearly states verb 'clear', resource 'network logs', and scope 'for a tab', distinguishing it from sibling tools like get_network_logs or get_network_errors.

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 on when to use (e.g., reset state before tests) or when not to use (e.g., when logs are needed). Alternatives like get_network_logs are not mentioned.

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