zap.get_active_scan_status
Check the current progress and status of active vulnerability scans in the VulneraMCP security testing platform to monitor ongoing security assessments.
Instructions
Get the status of an active scan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scanId | Yes | Active scan ID |
Implementation Reference
- src/tools/zap.ts:175-198 (registration)MCP tool registration for 'zap.get_active_scan_status', including input schema (requires scanId: string) and handler function that delegates to ZAPClient.getActiveScanStatus.server.tool( 'zap.get_active_scan_status', { description: 'Get the status of an active scan', inputSchema: { type: 'object', properties: { scanId: { type: 'string', description: 'Active scan ID', }, }, required: ['scanId'], }, }, async ({ scanId }: any): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getActiveScanStatus(scanId); return formatToolResult(result.success, result.data, result.error); } );
- src/tools/zap.ts:190-197 (handler)The MCP tool handler function executing the tool logic: checks ZAP client and calls getActiveScanStatus.async ({ scanId }: any): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getActiveScanStatus(scanId); return formatToolResult(result.success, result.data, result.error); }
- src/tools/zap.ts:177-188 (schema)Tool metadata including description and input schema.{ description: 'Get the status of an active scan', inputSchema: { type: 'object', properties: { scanId: { type: 'string', description: 'Active scan ID', }, }, required: ['scanId'], },
- src/integrations/zap.ts:182-201 (helper)ZAPClient helper method implementing the core API call to retrieve active scan status from ZAP's /ascan/view/status/ endpoint.async getActiveScanStatus(scanId: string): Promise<ZAPScanResult> { try { const response = await this.client.get('/ascan/view/status/', { params: { scanId: scanId.toString() }, }); return { success: true, data: { scanId, progress: parseInt(response.data.status || '0') || 0, status: response.data.status === '100' ? 'completed' : 'running', }, }; } catch (error: any) { return { success: false, error: error.message || 'Failed to get active scan status', }; } }