search_findings
Query and filter findings in vulnerability management using text, status, severity, and product name, with pagination support for efficient results navigation.
Instructions
Search for findings using a text query with pagination support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| product_name | No | ||
| query | Yes | ||
| severity | No | ||
| status | No |
Implementation Reference
- src/defectdojo/findings_tools.py:53-87 (handler)The handler function that implements the core logic of the 'search_findings' tool. It constructs filters from input parameters, retrieves the DefectDojo client, performs the search, and returns formatted results or errors.async def search_findings(query: str, product_name: Optional[str] = None, status: Optional[str] = None, severity: Optional[str] = None, limit: int = 20, offset: int = 0) -> Dict[str, Any]: """Search for findings using a text query with pagination. Args: query: Text to search for in findings product_name: Optional product name filter status: Optional status filter severity: Optional severity filter limit: Maximum number of findings to return per page (default: 20) offset: Number of records to skip (default: 0) Returns: Dictionary with status, data/error, and pagination metadata """ filters = {} if product_name: filters["product_name"] = product_name if status: filters["status"] = status if severity: filters["severity"] = severity if limit: filters["limit"] = limit if offset: filters["offset"] = offset client = get_client() result = await client.search_findings(query, filters) if "error" in result: return {"status": "error", "error": result["error"], "details": result.get("details", "")} return {"status": "success", "data": result}
- src/defectdojo/tools.py:37-40 (registration)Registers the 'search_findings' tool with the MCP server instance, binding the handler function imported from findings_tools.py.mcp.tool( name="search_findings", description="Search for findings using a text query with pagination support" )(search_findings)
- src/defectdojo/client.py:47-51 (helper)Helper method in the DefectDojoClient class that appends the search query to filters and makes the API request to retrieve search results for findings.async def search_findings(self, query: str, filters: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: """Search for findings using a text query.""" params = filters or {} params["search"] = query return await self._request("GET", "/api/v2/findings/", params=params)