get_scanner_output
Retrieve the scanner output for a specific occurrence of an issue by providing the issue ID and occurrence ID.
Instructions
Get scanner output for a specific occurrence of an issue.
Args:
issue_id: The ID of the issue
occurrence_id: The ID of the occurrence
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | ||
| occurrence_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- intruder_mcp/server.py:129-148 (handler)The tool handler function 'get_scanner_output' registered as an MCP tool. It takes issue_id and occurrence_id parameters, fetches scanner output via api.get_scanner_output_all(), and formats the output including plugin name, CVEs, and scanner output lines.
@mcp.tool() async def get_scanner_output(issue_id: int, occurrence_id: int) -> str: """ Get scanner output for a specific occurrence of an issue. Args: issue_id: The ID of the issue occurrence_id: The ID of the occurrence """ outputs = api.get_scanner_output_all(issue_id=issue_id, occurrence_id=occurrence_id) formatted = [] for output in outputs: plugin_info = f"Plugin: {output.plugin.name}" if output.plugin.cve: plugin_info += f" (CVEs: {', '.join(output.plugin.cve)})" formatted.append(plugin_info) formatted.append("Output:") formatted.extend(str(line) for line in output.scanner_output) formatted.append("") return "\n".join(formatted) - intruder_mcp/server.py:129-130 (registration)The tool is registered via the @mcp.tool() decorator on line 129, binding the 'get_scanner_output' async function to the MCP server.
@mcp.tool() async def get_scanner_output(issue_id: int, occurrence_id: int) -> str: - intruder_mcp/api_client.py:93-100 (helper)The API client method 'get_scanner_output' that performs the HTTP GET request to the Intruder API endpoint /issues/{issue_id}/occurrences/{occurrence_id}/scanner_output/ with pagination params.
def get_scanner_output(self, issue_id: int, occurrence_id: int, limit: Optional[int] = None, offset: Optional[int] = None) -> PaginatedScannerOutputListList: params = {} if limit: params["limit"] = limit if offset: params["offset"] = offset return PaginatedScannerOutputListList(**self.client.get(f"{self.base_url}/issues/{issue_id}/occurrences/{occurrence_id}/scanner_output/", params=params).json()) - intruder_mcp/api_client.py:102-110 (helper)The API client method 'get_scanner_output_all' which paginates through all scanner output results by calling get_scanner_output in a loop with offset.
def get_scanner_output_all(self, issue_id: int, occurrence_id: int) -> Generator[ScannerOutputList, None, None]: offset = 0 while True: response = self.get_scanner_output(issue_id, occurrence_id, limit=100, offset=offset) for output in response.results: yield output if not response.next: break offset += len(response.results)