list_products
Retrieve and filter products in DefectDojo using pagination for efficient vulnerability management. Supports parameters like name, product type, limit, and offset for customizable queries.
Instructions
List all products with optional filtering and pagination support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| name | No | ||
| offset | No | ||
| prod_type | No |
Implementation Reference
- src/defectdojo/products_tools.py:6-35 (handler)The core handler function that implements the logic for listing DefectDojo products with optional filters (name, product type), pagination (limit, offset), using the DefectDojo client.async def list_products(name: Optional[str] = None, prod_type: Optional[int] = None, limit: int = 50, offset: int = 0) -> Dict[str, Any]: """List all products with optional filtering and pagination. Args: name: Optional name filter (partial match) prod_type: Optional product type ID filter limit: Maximum number of products to return per page (default: 50) offset: Number of records to skip (default: 0) Returns: Dictionary with status, data/error, and pagination metadata """ filters = {"limit": limit} # Use __icontains for case-insensitive partial match if API supports it if name: filters["name"] = name # Or name__icontains if supported if prod_type: filters["prod_type"] = prod_type if offset: filters["offset"] = offset client = get_client() result = await client.get_products(filters) if "error" in result: return {"status": "error", "error": result["error"], "details": result.get("details", "")} return {"status": "success", "data": result}
- src/defectdojo/tools.py:59-62 (registration)Primary registration of the list_products tool using the central FastMCP instance in tools.py.name="list_products", description="List all products with optional filtering and pagination support" )(list_products)
- Module-specific registration function for the list_products tool in products_tools.py.def register_tools(mcp): """Register product-related tools with the MCP server instance.""" mcp.tool(name="list_products", description="List all products with optional filtering and pagination support")(list_products)
- src/defectdojo/tools.py:11-11 (registration)Import of the list_products handler from products_tools.py into the central tools.py.from .products_tools import list_products