list_products
Retrieve a list of Hotmart products with optional filters by status, format, ID, and pagination to manage product catalog.
Instructions
List Products
Retorna a lista de produtos.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | Número máximo de resultados por página | |
| page_token | No | Token de paginação para a próxima página | |
| id_ | No | ID do produto | |
| status | No | Status do produto. Values: DRAFT, ACTIVE, PAUSED, NOT_APPROVED, IN_REVIEW, DELETED, CHANGES_PENDING_ON_PRODUCT | |
| format_ | No | Formato do produto. Values: EBOOK, SOFTWARE, MOBILE_APPS, VIDEOS, AUDIOS, TEMPLATES, IMAGES, ONLINE_COURSE, SERIAL_CODES, ETICKET, ONLINE_SERVICE, ONLINE_EVENT, BUNDLE, COMMUNITY | |
| select | No | Seleção de campos customizados na resposta |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/hotmart_mcp/tools/products.py:11-45 (handler)The core handler function for the 'list_products' tool. Makes an HTTP GET request to /products/api/v1/products with optional filters (max_results, page_token, id_, status, format_, select) and returns the JSON response.
async def list_products( max_results: Optional[int] = None, page_token: Optional[str] = None, id_: Optional[int] = None, status: Optional[str] = None, format_: Optional[str] = None, select: Optional[str] = None, ) -> str: """List Products Retorna a lista de produtos. Args: max_results: Número máximo de resultados por página page_token: Token de paginação para a próxima página id_: ID do produto status: Status do produto. Values: DRAFT, ACTIVE, PAUSED, NOT_APPROVED, IN_REVIEW, DELETED, CHANGES_PENDING_ON_PRODUCT format_: Formato do produto. Values: EBOOK, SOFTWARE, MOBILE_APPS, VIDEOS, AUDIOS, TEMPLATES, IMAGES, ONLINE_COURSE, SERIAL_CODES, ETICKET, ONLINE_SERVICE, ONLINE_EVENT, BUNDLE, COMMUNITY select: Seleção de campos customizados na resposta""" endpoint = "/products/api/v1/products" params = {} if max_results is not None: params["max_results"] = max_results if page_token is not None: params["page_token"] = page_token if id_ is not None: params["id"] = id_ if status is not None: params["status"] = status if format_ is not None: params["format"] = format_ if select is not None: params["select"] = select result = await get_client().get(endpoint, params=params) return json.dumps(result, indent=2) - Type hints and docstring defining the input schema/parameters for list_products (max_results, page_token, id_, status, format_, select).
Args: max_results: Número máximo de resultados por página page_token: Token de paginação para a próxima página id_: ID do produto status: Status do produto. Values: DRAFT, ACTIVE, PAUSED, NOT_APPROVED, IN_REVIEW, DELETED, CHANGES_PENDING_ON_PRODUCT format_: Formato do produto. Values: EBOOK, SOFTWARE, MOBILE_APPS, VIDEOS, AUDIOS, TEMPLATES, IMAGES, ONLINE_COURSE, SERIAL_CODES, ETICKET, ONLINE_SERVICE, ONLINE_EVENT, BUNDLE, COMMUNITY select: Seleção de campos customizados na resposta""" endpoint = "/products/api/v1/products" params = {} if max_results is not None: params["max_results"] = max_results if page_token is not None: params["page_token"] = page_token if id_ is not None: params["id"] = id_ if status is not None: params["status"] = status if format_ is not None: params["format"] = format_ if select is not None: - src/hotmart_mcp/server.py:21-37 (registration)Dynamic tool registration in _discover_and_register_tools(). Scans all modules under hotmart_mcp.tools and registers every public async function (including list_products) with mcp.tool().
def _discover_and_register_tools() -> int: """Import all modules under hotmart_mcp.tools and register async functions.""" registered = 0 for module_info in pkgutil.iter_modules(tools_pkg.__path__, prefix=f"{tools_pkg.__name__}."): if module_info.name.endswith("__init__"): continue module = importlib.import_module(module_info.name) for name, obj in inspect.getmembers(module, iscoroutinefunction): if name.startswith("_"): continue mcp.tool()(obj) registered += 1 return registered - src/hotmart_mcp/_shared.py:10-14 (helper)The get_client() helper used by list_products to obtain a shared HotmartClient singleton instance.
def get_client() -> HotmartClient: global _client if _client is None: _client = HotmartClient() return _client - src/hotmart_mcp/client.py:197-203 (helper)The HotmartClient.get() method that list_products calls internally to execute the HTTP GET request.
async def get( self, path: str, params: dict[str, Any] | None = None, select: list[str] | None = None, ) -> dict[str, Any]: return await self._request("GET", path, params=params, select=select)