create_scan_schedule
Create recurring scan schedules to automate security assessments. Set frequency, target groups, and first scan time to run scans on schedule.
Instructions
Create a recurring scan schedule.
Args:
name: Name of the schedule
first_scan_time: ISO 8601 timestamp of the first scan. Must be in the future and on the hour
(e.g. '2026-05-01T03:00:00Z', not '2026-05-01T03:12:34Z')
scan_frequency: One of 'daily', 'weekly', 'monthly', 'quarterly'
target_ids: List of target IDs to include in the schedule
tag_names: List of target tag names to include in the schedule
throttled: Whether to throttle the scan
web_ports_only: Only scan standard web ports
upload_to_drata: Upload scan results to Drata
upload_to_vanta: Upload scan results to Vanta
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| first_scan_time | Yes | ||
| scan_frequency | Yes | ||
| target_ids | No | ||
| tag_names | No | ||
| throttled | No | ||
| web_ports_only | No | ||
| upload_to_drata | No | ||
| upload_to_vanta | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- intruder_mcp/server.py:343-382 (handler)The MCP tool handler for 'create_scan_schedule'. Decorated with @mcp.tool(), it parses the ISO 8601 timestamp, calls api.create_scan_schedule(), and formats the result via _format_schedule_result.
@mcp.tool() async def create_scan_schedule( name: str, first_scan_time: str, scan_frequency: ScanFrequencyEnum, target_ids: Optional[List[int]] = None, tag_names: Optional[List[str]] = None, throttled: Optional[bool] = None, web_ports_only: Optional[bool] = None, upload_to_drata: Optional[bool] = None, upload_to_vanta: Optional[bool] = None, ) -> str: """ Create a recurring scan schedule. Args: name: Name of the schedule first_scan_time: ISO 8601 timestamp of the first scan. Must be in the future and on the hour (e.g. '2026-05-01T03:00:00Z', not '2026-05-01T03:12:34Z') scan_frequency: One of 'daily', 'weekly', 'monthly', 'quarterly' target_ids: List of target IDs to include in the schedule tag_names: List of target tag names to include in the schedule throttled: Whether to throttle the scan web_ports_only: Only scan standard web ports upload_to_drata: Upload scan results to Drata upload_to_vanta: Upload scan results to Vanta """ parsed_first_scan_time = _parse_iso8601(first_scan_time) result = api.create_scan_schedule( name=name, first_scan_time=parsed_first_scan_time, scan_frequency=scan_frequency, tags=tag_names, targets=target_ids, throttled=throttled, web_ports_only=web_ports_only, upload_to_drata=upload_to_drata, upload_to_vanta=upload_to_vanta, ) return _format_schedule_result("Created", result.get("id"), result) - intruder_mcp/api_client.py:296-306 (helper)API client method that constructs an AssessmentScheduleCreateUpdateRequest and POSTs to the Intruder API's /scans/schedules/ endpoint.
def create_scan_schedule(self, name: str, first_scan_time: datetime, scan_frequency: ScanFrequencyEnum, tags: Optional[List[str]] = None, targets: Optional[List[int]] = None, throttled: Optional[bool] = None, web_ports_only: Optional[bool] = None, upload_to_drata: Optional[bool] = None, upload_to_vanta: Optional[bool] = None) -> dict: data = AssessmentScheduleCreateUpdateRequest( name=name, first_scan_time=first_scan_time, scan_frequency=scan_frequency, tags=tags, targets=targets, throttled=throttled, web_ports_only=web_ports_only, upload_to_drata=upload_to_drata, upload_to_vanta=upload_to_vanta, ) return self.client.post(f"{self.base_url}/scans/schedules/", json=data.model_dump(mode="json", exclude_none=True)).json() - intruder_mcp/enums.py:296-305 (schema)Pydantic model AssessmentScheduleCreateUpdateRequest used for request body validation when creating a scan schedule.
class AssessmentScheduleCreateUpdateRequest(BaseModel): name: str = Field(..., min_length=1) first_scan_time: datetime scan_frequency: ScanFrequencyEnum tags: Optional[List[str]] = None targets: Optional[List[int]] = None throttled: Optional[bool] = None web_ports_only: Optional[bool] = None upload_to_drata: Optional[bool] = None upload_to_vanta: Optional[bool] = None - intruder_mcp/enums.py:37-41 (schema)ScanFrequencyEnum defining allowed frequencies: daily, weekly, monthly, quarterly.
class ScanFrequencyEnum(str, Enum): MONTHLY = "monthly" DAILY = "daily" WEEKLY = "weekly" QUARTERLY = "quarterly" - intruder_mcp/server.py:10-11 (helper)Helper function _parse_iso8601 that converts an ISO 8601 string (with optional 'Z' suffix) to a datetime object.
def _parse_iso8601(value: str) -> datetime: return datetime.fromisoformat(value.replace("Z", "+00:00"))