change_subscription_due_day
Changes the due day of an active or delayed subscription by providing the subscriber code and new day (1-31). Adjusts day 31 to 30 for shorter months.
Instructions
Change Due Day
Altera o dia de vencimento de uma assinatura. Somente para assinaturas ACTIVE ou DELAYED. Não disponível para trial. O dia 31 será ajustado para 30 em meses mais curtos.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subscriber_code | Yes | Código do assinante | |
| due_day | Yes | Novo dia de vencimento (1-31) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The actual handler/implementation of the change_subscription_due_day tool. It makes a PATCH request to /payments/api/v1/subscriptions/{subscriber_code} with the due_day in the body.
async def change_subscription_due_day( subscriber_code: str, due_day: int, ) -> str: """Change Due Day Altera o dia de vencimento de uma assinatura. Somente para assinaturas ACTIVE ou DELAYED. Não disponível para trial. O dia 31 será ajustado para 30 em meses mais curtos. Args: subscriber_code: Código do assinante due_day: Novo dia de vencimento (1-31)""" endpoint = f"/payments/api/v1/subscriptions/{subscriber_code}" body = {} body["due_day"] = due_day result = await get_client().patch(endpoint, json=body) return json.dumps(result, indent=2) - src/hotmart_mcp/server.py:21-37 (registration)Auto-discovery registration in _discover_and_register_tools(). All async functions in the tools package (including change_subscription_due_day) are registered as MCP tools 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 - Docstring and parameters schema: subscriber_code (str) and due_day (int, 1-31).
"""Change Due Day Altera o dia de vencimento de uma assinatura. Somente para assinaturas ACTIVE ou DELAYED. Não disponível para trial. O dia 31 será ajustado para 30 em meses mais curtos. Args: subscriber_code: Código do assinante due_day: Novo dia de vencimento (1-31)""" - src/hotmart_mcp/client.py:221-227 (helper)The patch() helper method on HotmartClient that performs the actual HTTP PATCH request.
async def patch( self, path: str, json: dict[str, Any] | None = None, params: dict[str, Any] | None = None, ) -> dict[str, Any]: return await self._request("PATCH", path, params=params, json=json)