list_targets
Retrieve detailed information about all targets in your Intruder account, including IDs and statuses such as 'live', 'unscanned', or 'unresponsive', for efficient target management.
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 | |||
Input Schema (JSON Schema)
{
"properties": {},
"title": "list_targetsArguments",
"type": "object"
}
Implementation Reference
- intruder_mcp/server.py:29-38 (handler)The main handler for the 'list_targets' tool, registered via @mcp.tool() decorator. It calls the API helper to list all targets and formats the output as a string.@mcp.tool() 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/api_client.py:169-179 (helper)Supporting helper method in IntruderAPI class that implements pagination to retrieve all targets by repeatedly calling the paginated list_targets API endpoint.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)