Skip to main content
Glama

clear_network_capture

Clear captured network data to prevent memory issues while keeping the capture session active for continuous monitoring.

Instructions

Clear all captured network data without stopping the capture session. Resets request/response buffers while keeping capture active. Useful for long-running captures where you want to periodically clear old data to prevent memory issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID obtained from initialize_session

Implementation Reference

  • The core handler function that clears the captured network data (requests, responses, WS frames, streaming responses) for the given session ID without stopping the ongoing capture.
    export async function clearNetworkCapture(sessionId) {
      const session = global.activeSessions?.get(sessionId);
      if (!session) {
        throw new Error(`Session ${sessionId} not found.`);
      }
    
      const captureData = session.networkCapture;
      if (!captureData) {
        throw new Error(`No active network capture for session ${sessionId}.`);
      }
    
      // Clear all data arrays but keep capture running
      captureData.requests = [];
      captureData.responses = [];
      captureData.wsFrames = [];
      captureData.streamingResponses = [];
    
      return {
        sessionId,
        status: "cleared",
        message: "Network capture data cleared, capture continues",
        options: captureData.options,
      };
    }
  • src/index.js:379-393 (registration)
    Registers the clear_network_capture tool in the MCP server's tool list, including its description and input schema.
    {
      name: "clear_network_capture",
      description:
        "Clear all captured network data without stopping the capture session. Resets request/response buffers while keeping capture active. Useful for long-running captures where you want to periodically clear old data to prevent memory issues.",
      inputSchema: {
        type: "object",
        properties: {
          sessionId: {
            type: "string",
            description: "Session ID obtained from initialize_session",
          },
        },
        required: ["sessionId"],
      },
    },
  • Input schema definition for the clear_network_capture tool, specifying the required sessionId parameter.
    inputSchema: {
      type: "object",
      properties: {
        sessionId: {
          type: "string",
          description: "Session ID obtained from initialize_session",
        },
      },
      required: ["sessionId"],
    },
  • Switch case in the MCP CallTool request handler that validates input and invokes the clearNetworkCapture handler.
    case "clear_network_capture": {
      const { sessionId } = args;
      if (!sessionId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "sessionId parameter is required"
        );
      }
      result = await clearNetworkCapture(sessionId);
      break;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's a mutation tool (clears data), it resets buffers while keeping the session active, and it addresses memory management. However, it lacks details on permissions, error handling, or response format, leaving some behavioral aspects unclear.

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?

The description is front-loaded with the core purpose in the first sentence, followed by clarifying details and usage context. Each sentence adds value: the first defines the action, the second explains the effect, and the third provides practical guidance. There is no redundant or wasted text, making it highly efficient.

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?

Given the tool's moderate complexity (a mutation with one parameter) and no annotations or output schema, the description is largely complete. It covers purpose, behavior, and usage context adequately. However, it omits details on return values or error cases, which could be important for a mutation tool, slightly reducing completeness.

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?

The input schema has 100% description coverage, with the 'sessionId' parameter fully documented. The description does not add any parameter-specific information beyond what the schema provides, such as format examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 specific action ('Clear all captured network data') and distinguishes it from sibling tools like 'stop_network_capture' by specifying it happens 'without stopping the capture session.' It uses precise verbs ('clear,' 'resets') and identifies the resource ('captured network data,' 'request/response buffers').

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

Usage Guidelines4/5

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

The description provides clear context on when to use it ('Useful for long-running captures where you want to periodically clear old data to prevent memory issues'), but it does not explicitly state when not to use it or name alternatives (e.g., 'stop_network_capture' for ending a session). The guidance is helpful but lacks exclusions or direct sibling comparisons.

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/pyscout/webscout-mcp'

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