list_targets
Retrieve all targets in your Intruder account with their IDs and status. Identify target statuses like live or unscanned.
Instructions
List all targets in the Intruder account and their associated IDs and status (one of 'live', 'license_exceeded', 'unscanned', 'unresponsive', 'agent_uninstalled').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- intruder_mcp/server.py:36-43 (handler)The MCP tool handler for 'list_targets'. It calls api.list_targets_all() and formats the output as a string of IDs, addresses, and statuses.
async def list_targets() -> str: """ List all targets in the Intruder account and their associated IDs and status (one of 'live', 'license_exceeded', 'unscanned', 'unresponsive', 'agent_uninstalled'). """ targets = api.list_targets_all() formatted = [f"{target.id} - {target.address} ({target.target_status})" for target in targets] return "\n".join(formatted) - intruder_mcp/server.py:35-36 (registration)Registration of the 'list_targets' tool via the @mcp.tool() decorator on the async function.
@mcp.tool() async def list_targets() -> str: - intruder_mcp/api_client.py:171-180 (helper)Helper method list_targets_all() that paginates through all targets via the API, yielding Target objects.
def list_targets_all(self, address: Optional[str] = None, target_status: Optional[str] = None) -> Generator[Target, None, None]: offset = 0 while True: response = self.list_targets(address=address, target_status=target_status, limit=100, offset=offset) for target in response.results: yield target if not response.next: break offset += len(response.results) - intruder_mcp/api_client.py:158-169 (helper)Helper method list_targets() that calls the /targets/ API endpoint with optional filters and returns a PaginatedTargetList.
def list_targets(self, address: Optional[str] = None, target_status: Optional[str] = None, limit: Optional[int] = None, offset: Optional[int] = None) -> PaginatedTargetList: params = {} if address: params["address"] = address if target_status: params["target_status"] = target_status if limit: params["limit"] = limit if offset: params["offset"] = offset return PaginatedTargetList(**self.client.get(f"{self.base_url}/targets/", params=params).json()) - intruder_mcp/enums.py:117-125 (schema)The Target Pydantic model used for deserializing target data returned by the API, including id, address, target_status, tags, etc.
class Target(BaseModel): id: int address: str has_api_schemas: bool has_authentications: bool license_type: Optional[LicenseTypeEnum] = None tags: Optional[List[Optional[str]]] = None target_status: TargetStatusEnum