zap.get_spider_status
Check the current status of an active web spider scan to monitor crawling progress and completion.
Instructions
Get the status of a spider scan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scanId | Yes | Spider scan ID |
Implementation Reference
- src/tools/zap.ts:100-123 (registration)Tool registration for 'zap.get_spider_status' including input schema definition and handler function that delegates to ZAPClient.getSpiderStatus.server.tool( 'zap.get_spider_status', { description: 'Get the status of a spider scan', inputSchema: { type: 'object', properties: { scanId: { type: 'string', description: 'Spider 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.getSpiderStatus(scanId); return formatToolResult(result.success, result.data, result.error); } );
- src/integrations/zap.ts:124-143 (helper)Core implementation of spider status retrieval via ZAP REST API (/spider/view/status/) in the ZAPClient class, called by the tool handler.async getSpiderStatus(scanId: string): Promise<ZAPScanResult> { try { const response = await this.client.get('/spider/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 spider status', }; } }
- src/index.ts:49-49 (registration)Top-level call to register all ZAP tools, including zap.get_spider_status, on the MCP server.registerZAPTools(server);
- src/integrations/zap.ts:9-13 (schema)Type definition for the spider status result returned by the ZAPClient method.export interface ZAPSpiderResult { scanId: string; progress: number; status: string; }