cancel_scan
Stop an active security scan by providing its scan ID. Use this tool to halt ongoing vulnerability assessments in the nuclei-server environment.
Instructions
Cancel a running scan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scanId | Yes | Scan ID to cancel |
Implementation Reference
- src/index.ts:220-237 (handler)Handler for the 'cancel_scan' tool: validates the scan ID, checks if running, kills the process, resets progress, sets status to 'canceled', and returns confirmation.if (request.params.name === "cancel_scan") { const { scanId } = request.params.arguments as { scanId: string }; const scan = scans[scanId]; if (!scan) { return { content: [{ type: "text", text: `Scan ${scanId} not found` }], isError: true }; } if (scan.status !== "running" || !scan.process) { return { content: [{ type: "text", text: `Scan ${scanId} is not running` }], isError: true }; } scan.process.kill(); scans[scanId].progress = 0; scan.status = "canceled"; return { content: [{ type: "text", text: `Scan ${scanId} has been canceled` }] }; }
- src/index.ts:96-107 (registration)Registration of the 'cancel_scan' tool in ListToolsRequestSchema response, including name, description, and input schema.{ name: "cancel_scan", description: "Cancel a running scan", inputSchema: { type: "object", properties: { scanId: { type: "string", description: "Scan ID to cancel" }, }, required: ["scanId"], }, }, ],
- src/index.ts:99-105 (schema)Input schema definition for 'cancel_scan' tool, requiring a 'scanId' string.inputSchema: { type: "object", properties: { scanId: { type: "string", description: "Scan ID to cancel" }, }, required: ["scanId"], },