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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>"
},
"name": "get_network_capture_status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID obtained from initialize_session |
Implementation Reference
- src/tools/networkCapture.js:260-290 (handler)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, }; } - src/index.js:364-378 (schema)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; - src/tools/reverseEngineer.js:22-27 (registration)Re-export of the getNetworkCaptureStatus function from networkCapture.js to centralize imports.
export { startNetworkCapture, stopNetworkCapture, getNetworkCaptureStatus, clearNetworkCapture, } from "./networkCapture.js";