get_modules
Retrieve modules of a Hotmart membership area by providing the subdomain. Optionally filter extra modules or select specific fields.
Instructions
Get Modules
Retorna os módulos da área de membros.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subdomain | Yes | Subdomínio da área de membros | |
| is_extra | No | Filtrar módulos extras | |
| select | No | Seleção de campos customizados na resposta |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/hotmart_mcp/tools/club.py:11-33 (handler)The get_modules handler function. Makes a GET request to /club/api/v1/modules with subdomain, is_extra, and select query params, then returns JSON response.
async def get_modules( subdomain: str, is_extra: Optional[bool] = None, select: Optional[str] = None, ) -> str: """Get Modules Retorna os módulos da área de membros. Args: subdomain: Subdomínio da área de membros is_extra: Filtrar módulos extras select: Seleção de campos customizados na resposta""" endpoint = "/club/api/v1/modules" params = {} if subdomain is not None: params["subdomain"] = subdomain if is_extra is not None: params["is_extra"] = is_extra if select is not None: params["select"] = select result = await get_client().get(endpoint, params=params) return json.dumps(result, indent=2) - src/hotmart_mcp/tools/club.py:11-33 (schema)The function signature defines the schema/input types: subdomain (str, required), is_extra (Optional[bool]), and select (Optional[str]). The return type is str (JSON).
async def get_modules( subdomain: str, is_extra: Optional[bool] = None, select: Optional[str] = None, ) -> str: """Get Modules Retorna os módulos da área de membros. Args: subdomain: Subdomínio da área de membros is_extra: Filtrar módulos extras select: Seleção de campos customizados na resposta""" endpoint = "/club/api/v1/modules" params = {} if subdomain is not None: params["subdomain"] = subdomain if is_extra is not None: params["is_extra"] = is_extra if select is not None: params["select"] = select result = await get_client().get(endpoint, params=params) return json.dumps(result, indent=2) - src/hotmart_mcp/server.py:21-37 (registration)Automatic registration: _discover_and_register_tools iterates all modules in hotmart_mcp.tools, finds async functions (like get_modules), and registers them via mcp.tool()(obj).
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)get_client() helper returns a singleton HotmartClient instance, used by get_modules to make the API call.
def get_client() -> HotmartClient: global _client if _client is None: _client = HotmartClient() return _client - src/hotmart_mcp/tools/club.py:8-8 (helper)get_modules is exported via __all__ in the club module.
__all__ = ["get_modules", "get_module_pages", "get_students", "get_student_progress"]