Skip to main content
Glama
products_tools.py1.48 kB
from typing import Any, Dict, Optional from defectdojo.client import get_client # --- Product Tool Definitions --- 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} # --- Registration Function --- 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)

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jamiesonio/defectdojo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server