get_scan
Retrieve details of a specific security scan by providing its scan ID.
Instructions
Get details of a specific scan.
Args:
scan_id: The ID of the scan to get
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scan_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- intruder_mcp/server.py:162-186 (handler)The MCP tool handler for 'get_scan'. It is decorated with @mcp.tool(), takes a scan_id parameter, calls api.get_scan(scan_id), and returns formatted scan details (id, type, status, schedule, created_at, start_time, completed_time, target_addresses).
@mcp.tool() async def get_scan(scan_id: int) -> str: """ Get details of a specific scan. Args: scan_id: The ID of the scan to get """ scan = api.get_scan(scan_id) details = [ f"Scan {scan.id} ({scan.scan_type})", f"Status: {scan.status}", f"Schedule: {scan.schedule_period}", f"Created: {scan.created_at}", f"Type: {scan.scan_type}" ] if scan.start_time: details.append(f"Started: {scan.start_time}") if scan.completed_time: details.append(f"Completed: {scan.completed_time}") if scan.target_addresses: details.append("\nTargets:") details.extend(f"- {addr}" for addr in scan.target_addresses) return "\n".join(details) - intruder_mcp/api_client.py:187-188 (helper)The API client helper method 'get_scan' that actually makes the HTTP GET request to /scans/{scan_id}/ and returns a Scan pydantic model.
def get_scan(self, scan_id: int) -> Scan: return Scan(**self.client.get(f"{self.base_url}/scans/{scan_id}/").json()) - intruder_mcp/enums.py:131-140 (schema)The 'Scan' pydantic model schema used to deserialize the API response. Contains fields: id, status, created_at, target_addresses, scan_type, schedule_period, start_time, completed_time.
class Scan(BaseModel): id: int status: ScanStatusField created_at: datetime target_addresses: Optional[List[str]] = None scan_type: ScanTypeEnum schedule_period: SchedulePeriodEnum start_time: Optional[datetime] = None completed_time: Optional[datetime] = None