Skip to main content
Glama

get_product_offers

Retrieve offers for a specific product by providing the product ID, with optional filtering and pagination.

Instructions

Get Product Offers

Retorna as ofertas de um produto.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYesID do produto
max_resultsNoNúmero máximo de resultados por página
page_tokenNoToken de paginação para a próxima página
offer_keyNoChave da oferta
selectNoSeleção de campos customizados na resposta

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Async function that implements the get_product_offers tool. Makes a GET request to /products/api/v1/products/{product_id}/offers with optional query params (max_results, page_token, offer_key, select) and returns the result as a JSON string.
    async def get_product_offers(
        product_id: int,
        max_results: Optional[int] = None,
        page_token: Optional[str] = None,
        offer_key: Optional[str] = None,
        select: Optional[str] = None,
    ) -> str:
        """Get Product Offers
        
        Retorna as ofertas de um produto.
        
        Args:
            product_id: ID do produto
            max_results: Número máximo de resultados por página
            page_token: Token de paginação para a próxima página
            offer_key: Chave da oferta
            select: Seleção de campos customizados na resposta"""
        endpoint = f"/products/api/v1/products/{product_id}/offers"
        params = {}
        if max_results is not None:
            params["max_results"] = max_results
        if page_token is not None:
            params["page_token"] = page_token
        if offer_key is not None:
            params["offer_key"] = offer_key
        if select is not None:
            params["select"] = select
        result = await get_client().get(endpoint, params=params)
        return json.dumps(result, indent=2)
  • Export registration: get_product_offers is exposed in the module's __all__ list.
    __all__ = ["list_products", "get_product_offers", "get_product_plans"]
  • Auto-registration: server.py discovers all async functions (including get_product_offers) from the tools package and registers them as MCP tools via 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
  • Shared helper that provides a lazy singleton HotmartClient instance used by get_product_offers to make the API request.
    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?

No annotations are present, so the description carries full burden. It does not disclose behaviors like pagination, error handling, or performance implications. The existence of pagination parameters (max_results, page_token) is not mentioned.

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 short but redundant: it repeats the title "Get Product Offers" and then the Portuguese equivalent. It is not overly verbose, but could be more efficiently structured by removing duplication.

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 tool has 5 parameters, pagination, and an output schema, the description lacks necessary context for an agent to use it effectively. No mention of pagination behavior, filtering, or field selection is provided.

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?

Schema coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions. It does not explain relationships or usage patterns for parameters like offer_key or select.

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

Purpose4/5

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

The description clearly states the tool returns offers for a product ("Retorna as ofertas de um produto"). It distinguishes from siblings like list_products or get_product_plans, though not explicitly. The verb 'get' and resource 'product offers' are specific.

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?

No guidance is provided on when to use this tool vs. alternatives (e.g., get_product_plans, list_products). There are no usage contexts, prerequisites, or exclusions, leaving the agent without direction.

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