Skip to main content
Glama

zap.get_active_scan_status

Check the current status of an active vulnerability scan to monitor progress and identify when testing is complete.

Instructions

Get the status of an active scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scanIdYesActive scan ID

Implementation Reference

  • Registration of the MCP tool 'zap.get_active_scan_status' including input schema and inline 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); } );
  • Core handler implementation in ZAPClient class: queries ZAP REST API endpoint /ascan/view/status/ to retrieve the scan ID, progress percentage, and status (running/completed).
    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', }; } }
  • TypeScript interface defining the structure of the active scan status result returned by the handler.
    export interface ZAPActiveScanResult { scanId: string; progress: number; status: string; }
  • Singleton accessor function for the ZAPClient instance, used by the MCP tool handler.
    export function getZAPClient(): ZAPClient | null { return zapClient; }

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/telmon95/VulneraMCP'

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