get_event_participants
Retrieve participants of a Hotmart event. Filter by email, ticket status, check-in status, or e-ticket details.
Instructions
Event Participants
Retorna os participantes de um evento.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | ID do evento | |
| 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 | |
| buyer_email | No | E-mail do comprador | |
| participant_email | No | E-mail do participante | |
| last_update | No | Última atualização (timestamp em milissegundos) | |
| id_lot | No | ID do lote | |
| ticket_status | No | Status do ingresso. Values: SOLD, INVITE, INVITE_CANCELED, REFUNDED, CHARGEBACK, EXCLUDED, AVAILABLE, RESERVED | |
| ticket_type | No | Tipo do ingresso. Values: PAID, FREE, ALL | |
| checkin_status | No | Status do check-in. Values: PENDING, PARTIAL, CONCLUDED, ALL | |
| id_eticket | No | ID do e-ticket | |
| ticket_qr_code | No | QR code do ingresso | |
| select | No | Seleção de campos customizados na resposta |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/hotmart_mcp/tools/tickets.py:30-90 (handler)The async function get_event_participants that implements the tool logic. It builds query params from optional arguments, calls the Hotmart API endpoint /events/api/v1/{event_id}/participants via get_client().get(), and returns the JSON result.
async def get_event_participants( event_id: int, max_results: Optional[int] = None, page_token: Optional[str] = None, buyer_email: Optional[str] = None, participant_email: Optional[str] = None, last_update: Optional[int] = None, id_lot: Optional[int] = None, ticket_status: Optional[str] = None, ticket_type: Optional[str] = None, checkin_status: Optional[str] = None, id_eticket: Optional[int] = None, ticket_qr_code: Optional[str] = None, select: Optional[str] = None, ) -> str: """Event Participants Retorna os participantes de um evento. Args: event_id: ID do evento max_results: Número máximo de resultados por página page_token: Token de paginação para a próxima página buyer_email: E-mail do comprador participant_email: E-mail do participante last_update: Última atualização (timestamp em milissegundos) id_lot: ID do lote ticket_status: Status do ingresso. Values: SOLD, INVITE, INVITE_CANCELED, REFUNDED, CHARGEBACK, EXCLUDED, AVAILABLE, RESERVED ticket_type: Tipo do ingresso. Values: PAID, FREE, ALL checkin_status: Status do check-in. Values: PENDING, PARTIAL, CONCLUDED, ALL id_eticket: ID do e-ticket ticket_qr_code: QR code do ingresso select: Seleção de campos customizados na resposta""" endpoint = f"/events/api/v1/{event_id}/participants" params = {} if max_results is not None: params["max_results"] = max_results if page_token is not None: params["page_token"] = page_token if buyer_email is not None: params["buyer_email"] = buyer_email if participant_email is not None: params["participant_email"] = participant_email if last_update is not None: params["last_update"] = last_update if id_lot is not None: params["id_lot"] = id_lot if ticket_status is not None: params["ticket_status"] = ticket_status if ticket_type is not None: params["ticket_type"] = ticket_type if checkin_status is not None: params["checkin_status"] = checkin_status if id_eticket is not None: params["id_eticket"] = id_eticket if ticket_qr_code is not None: params["ticket_qr_code"] = ticket_qr_code 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)The _discover_and_register_tools function that auto-discovers all async functions in the tools package and registers them with FastMCP via mcp.tool()(obj). This dynamically registers get_event_participants as an 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 that provides a shared lazy singleton HotmartClient instance used by the handler to make API calls.
def get_client() -> HotmartClient: global _client if _client is None: _client = HotmartClient() return _client - The function signature serves as the schema: event_id (int, required), plus many optional parameters (max_results, page_token, buyer_email, participant_email, last_update, id_lot, ticket_status, ticket_type, checkin_status, id_eticket, ticket_qr_code, select) defining the expected inputs.
async def get_event_participants( event_id: int, max_results: Optional[int] = None, page_token: Optional[str] = None, buyer_email: Optional[str] = None, participant_email: Optional[str] = None, last_update: Optional[int] = None, id_lot: Optional[int] = None, ticket_status: Optional[str] = None, ticket_type: Optional[str] = None, checkin_status: Optional[str] = None, id_eticket: Optional[int] = None, ticket_qr_code: Optional[str] = None, select: Optional[str] = None, ) -> str: """Event Participants Retorna os participantes de um evento. Args: event_id: ID do evento max_results: Número máximo de resultados por página page_token: Token de paginação para a próxima página buyer_email: E-mail do comprador participant_email: E-mail do participante last_update: Última atualização (timestamp em milissegundos) id_lot: ID do lote ticket_status: Status do ingresso. Values: SOLD, INVITE, INVITE_CANCELED, REFUNDED, CHARGEBACK, EXCLUDED, AVAILABLE, RESERVED ticket_type: Tipo do ingresso. Values: PAID, FREE, ALL checkin_status: Status do check-in. Values: PENDING, PARTIAL, CONCLUDED, ALL id_eticket: ID do e-ticket ticket_qr_code: QR code do ingresso select: Seleção de campos customizados na resposta""" endpoint = f"/events/api/v1/{event_id}/participants" params = {} if max_results is not None: params["max_results"] = max_results if page_token is not None: params["page_token"] = page_token if buyer_email is not None: params["buyer_email"] = buyer_email if participant_email is not None: params["participant_email"] = participant_email if last_update is not None: params["last_update"] = last_update if id_lot is not None: params["id_lot"] = id_lot if ticket_status is not None: params["ticket_status"] = ticket_status if ticket_type is not None: params["ticket_type"] = ticket_type if checkin_status is not None: params["checkin_status"] = checkin_status if id_eticket is not None: params["id_eticket"] = id_eticket if ticket_qr_code is not None: params["ticket_qr_code"] = ticket_qr_code if select is not None: params["select"] = select result = await get_client().get(endpoint, params=params) return json.dumps(result, indent=2)