get_subscriber_purchases
Retrieve all purchases made by a specific subscriber using their subscriber code.
Instructions
Subscriber Purchases
Retorna as compras de um assinante.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subscriber_code | Yes | Código do assinante |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The handler function that executes the tool - makes a GET request to retrieve purchases for a given subscriber code.
async def get_subscriber_purchases( subscriber_code: str, ) -> str: """Subscriber Purchases Retorna as compras de um assinante. Args: subscriber_code: Código do assinante""" endpoint = f"/payments/api/v1/subscriptions/{subscriber_code}/purchases" result = await get_client().get(endpoint) return json.dumps(result, indent=2) - src/hotmart_mcp/server.py:21-37 (registration)Tool registration mechanism - dynamically discovers all async functions (including get_subscriber_purchases) from the tools package and registers them with FastMCP.
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 - Imports the get_client helper used to make the HTTP request to the Hotmart API.
from hotmart_mcp._shared import get_client