Skip to main content
Glama

get_subscriptions

Filter and retrieve Hotmart subscriptions by product, plan, status, subscriber, or date. Get paginated lists for data analysis.

Instructions

Get Subscriptions

Retorna a lista de assinaturas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_resultsNoNúmero máximo de resultados por página
page_tokenNoToken de paginação para a próxima página
product_idNoID do produto
planNoNomes dos planos
plan_idNoID do plano
accession_dateNoData de adesão inicial (timestamp em milissegundos)
end_accession_dateNoData de adesão final (timestamp em milissegundos)
statusNoStatus da assinatura. Values: ACTIVE, INACTIVE, DELAYED, CANCELLED_BY_CUSTOMER, CANCELLED_BY_SELLER, CANCELLED_BY_ADMIN, STARTED, OVERDUE
subscriber_codeNoCódigo do assinante
subscriber_emailNoE-mail do assinante
transactionNoCódigo da transação
trialNoFiltrar por trial
cancelation_dateNoData de cancelamento inicial (timestamp em milissegundos)
end_cancelation_dateNoData de cancelamento final (timestamp em milissegundos)
date_next_chargeNoData da próxima cobrança inicial (timestamp em milissegundos)
end_date_next_chargeNoData da próxima cobrança final (timestamp em milissegundos)
selectNoSeleção de campos customizados na resposta

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_subscriptions' tool. It accepts optional filter parameters (max_results, page_token, product_id, plan, plan_id, accession_date, status, subscriber_code, etc.), builds a params dict, makes a GET request to the Hotmart API endpoint '/payments/api/v1/subscriptions', and returns the JSON response.
    async def get_subscriptions(
        max_results: Optional[int] = None,
        page_token: Optional[str] = None,
        product_id: Optional[int] = None,
        plan: Optional[list[str]] = None,
        plan_id: Optional[int] = None,
        accession_date: Optional[int] = None,
        end_accession_date: Optional[int] = None,
        status: Optional[str] = None,
        subscriber_code: Optional[str] = None,
        subscriber_email: Optional[str] = None,
        transaction: Optional[str] = None,
        trial: Optional[bool] = None,
        cancelation_date: Optional[int] = None,
        end_cancelation_date: Optional[int] = None,
        date_next_charge: Optional[int] = None,
        end_date_next_charge: Optional[int] = None,
        select: Optional[str] = None,
    ) -> str:
        """Get Subscriptions
        
        Retorna a lista de assinaturas.
        
        Args:
            max_results: Número máximo de resultados por página
            page_token: Token de paginação para a próxima página
            product_id: ID do produto
            plan: Nomes dos planos
            plan_id: ID do plano
            accession_date: Data de adesão inicial (timestamp em milissegundos)
            end_accession_date: Data de adesão final (timestamp em milissegundos)
            status: Status da assinatura. Values: ACTIVE, INACTIVE, DELAYED, CANCELLED_BY_CUSTOMER, CANCELLED_BY_SELLER, CANCELLED_BY_ADMIN, STARTED, OVERDUE
            subscriber_code: Código do assinante
            subscriber_email: E-mail do assinante
            transaction: Código da transação
            trial: Filtrar por trial
            cancelation_date: Data de cancelamento inicial (timestamp em milissegundos)
            end_cancelation_date: Data de cancelamento final (timestamp em milissegundos)
            date_next_charge: Data da próxima cobrança inicial (timestamp em milissegundos)
            end_date_next_charge: Data da próxima cobrança final (timestamp em milissegundos)
            select: Seleção de campos customizados na resposta"""
        endpoint = "/payments/api/v1/subscriptions"
        params = {}
        if max_results is not None:
            params["max_results"] = max_results
        if page_token is not None:
            params["page_token"] = page_token
        if product_id is not None:
            params["product_id"] = product_id
        if plan is not None:
            params["plan"] = plan
        if plan_id is not None:
            params["plan_id"] = plan_id
        if accession_date is not None:
            params["accession_date"] = accession_date
        if end_accession_date is not None:
            params["end_accession_date"] = end_accession_date
        if status is not None:
            params["status"] = status
        if subscriber_code is not None:
            params["subscriber_code"] = subscriber_code
        if subscriber_email is not None:
            params["subscriber_email"] = subscriber_email
        if transaction is not None:
            params["transaction"] = transaction
        if trial is not None:
            params["trial"] = trial
        if cancelation_date is not None:
            params["cancelation_date"] = cancelation_date
        if end_cancelation_date is not None:
            params["end_cancelation_date"] = end_cancelation_date
        if date_next_charge is not None:
            params["date_next_charge"] = date_next_charge
        if end_date_next_charge is not None:
            params["end_date_next_charge"] = end_date_next_charge
        if select is not None:
            params["select"] = select
        result = await get_client().get(endpoint, params=params)
        return json.dumps(result, indent=2)
  • Tool registration via auto-discovery. '_discover_and_register_tools' iterates over all modules in hotmart_mcp.tools and registers every public async function (including get_subscriptions) as a FastMCP tool using 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
  • The function signature defines the input schema: all optional parameters with types (Optional[int], Optional[str], Optional[list[str]], Optional[bool]) and the status enum values documented in the docstring.
    async def get_subscriptions(
        max_results: Optional[int] = None,
        page_token: Optional[str] = None,
        product_id: Optional[int] = None,
        plan: Optional[list[str]] = None,
        plan_id: Optional[int] = None,
        accession_date: Optional[int] = None,
        end_accession_date: Optional[int] = None,
        status: Optional[str] = None,
        subscriber_code: Optional[str] = None,
        subscriber_email: Optional[str] = None,
        transaction: Optional[str] = None,
        trial: Optional[bool] = None,
        cancelation_date: Optional[int] = None,
        end_cancelation_date: Optional[int] = None,
        date_next_charge: Optional[int] = None,
        end_date_next_charge: Optional[int] = None,
        select: Optional[str] = None,
    ) -> str:
  • Helper function 'get_client()' that provides the shared HotmartClient singleton used by get_subscriptions to make the API call.
    def get_client() -> HotmartClient:
        global _client
        if _client is None:
            _client = HotmartClient()
        return _client
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral context. It does not disclose that the tool is read-only, requires authentication, or returns paginated results. The schema implies pagination via page_token and max_results, but the description doesn't confirm this or mention any rate limits or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (two short sentences), but this is not a virtue because it omits critical information. It lacks structure and does not front-load key details like filtering or pagination.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (17 parameters, many sibling tools, no annotations, and an existing output schema), the description is too sparse. It should mention that the tool supports multiple filters, pagination, and the type of response (e.g., a page of subscriptions). The output schema exists but is not described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with each parameter already described in Portuguese. The description adds no additional meaning beyond what the schema provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Get Subscriptions' and 'Returns the list of subscriptions,' which gives a basic verb-resource pair. However, it does not distinguish from sibling tools like get_subscriptions_summary or get_subscription_transactions, nor does it clarify that it supports filtering and pagination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. No mention of how filtering parameters affect results or how pagination works. Sibling tools are not referenced at all.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thaleslaray/hotmart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server