Skip to main content
Glama

get_network_capture_status

Check active network capture status, duration, and statistics to monitor progress or verify if capture is running before stopping.

Instructions

Get the current status of network capture for a session. Returns whether capture is active, duration, current statistics, and capture options. Useful for monitoring capture progress or checking if capture is running before stopping.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID obtained from initialize_session

Implementation Reference

  • The main handler function that retrieves the current status of network capture for the given session ID, including whether it's active, duration, stats, and options.
    export async function getNetworkCaptureStatus(sessionId) { const session = global.activeSessions?.get(sessionId); if (!session) { throw new Error(`Session ${sessionId} not found.`); } const captureData = session.networkCapture; if (!captureData) { return { sessionId, status: "inactive", message: "No active network capture session", }; } const duration = Date.now() - captureData.startTime; return { sessionId, status: "active", startTime: new Date(captureData.startTime).toISOString(), duration, currentStats: { requests: captureData.requests.length, responses: captureData.responses.length, wsFrames: captureData.wsFrames.length, streamingResponses: captureData.streamingResponses.length, }, options: captureData.options, }; }
  • Input schema definition for the get_network_capture_status tool in the ListTools response.
    { name: "get_network_capture_status", description: "Get the current status of network capture for a session. Returns whether capture is active, duration, current statistics, and capture options. Useful for monitoring capture progress or checking if capture is running before stopping.", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "Session ID obtained from initialize_session", }, }, required: ["sessionId"], }, },
  • src/index.js:579-588 (registration)
    Registration of the tool handler in the switch statement within the CallToolRequest handler.
    case "get_network_capture_status": { const { sessionId } = args; if (!sessionId) { throw new McpError( ErrorCode.InvalidParams, "sessionId parameter is required" ); } result = await getNetworkCaptureStatus(sessionId); break;
  • Re-export of the getNetworkCaptureStatus function from networkCapture.js to centralize imports.
    export { startNetworkCapture, stopNetworkCapture, getNetworkCaptureStatus, clearNetworkCapture, } from "./networkCapture.js";

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