Skip to main content
Glama

hotmart_sale_refund

Refund a Hotmart sale by providing the transaction code.

Instructions

Sales Refund. Example: hotmart_sale_refund(transaction_code='ABC123XY').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_codeYesTransaction code. Format: alphanumeric Hotmart code (ex: `H123A4B5`, not UUID, not int)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that performs a sale refund by sending a PUT request to /payments/api/v1/sales/{transaction_code}/refund using the authenticated HTTP client.
    async def hotmart_sale_refund(
        transaction_code: str,
    ) -> str:
        """Sales Refund. Example: hotmart_sale_refund(transaction_code='ABC123XY').
        
        Args:
            transaction_code: Transaction code. Format: alphanumeric Hotmart code (ex: `H123A4B5`, not UUID, not int)"""
        endpoint = f"/payments/api/v1/sales/{transaction_code}/refund"
        result = await get_client().put(endpoint)
        return json.dumps(result, indent=2)
  • Auto-registration mechanism that discovers all async functions (including hotmart_sale_refund) from the hotmart_mcp.tools package and registers them as FastMCP tools.
    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 input parameter: a required string 'transaction_code' (alphanumeric Hotmart code, e.g. H123A4B5).
    transaction_code: str,
  • The shared helper 'get_client' provides the authenticated HTTP client used to make the PUT request for the refund.
    from hotmart_mcp._shared import get_client
    
    __all__ = ["hotmart_sales_history_list", "hotmart_sales_summary_list", "hotmart_sales_participants_list", "hotmart_sales_commissions_list", "hotmart_sales_price_details_list", "hotmart_sale_refund"]
  • The module's __all__ export list which explicitly includes hotmart_sale_refund as a public member.
    __all__ = ["hotmart_sales_history_list", "hotmart_sales_summary_list", "hotmart_sales_participants_list", "hotmart_sales_commissions_list", "hotmart_sales_price_details_list", "hotmart_sale_refund"]
Behavior1/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It does not mention side effects (e.g., does it reverse a transaction permanently?), permission requirements, rate limits, or success/failure behavior. The agent is left uninformed about the tool's impact.

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

Conciseness5/5

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

The description is extremely concise: one sentence and one example. It is front-loaded with the purpose and includes a practical example, with no unnecessary words.

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

Completeness3/5

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

Given the tool's simplicity (one required parameter, output schema present), the description provides minimal but sufficient information to understand the basic operation. However, it lacks behavioral context that would help an agent handle errors or side effects, making it adequate but not comprehensive.

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

Parameters4/5

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

The schema provides 100% coverage for the single parameter, but the description adds an example showing the exact format (transaction_code='ABC123XY'), which is more concrete than the schema's description. This helps the agent understand the expected input pattern.

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 'Sales Refund' and provides an example call, making the purpose clear. However, it does not explicitly differentiate from sibling tools like hotmart_sales_summary_list, leaving room for confusion if multiple tools could be applied.

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 given on when to use this tool versus alternatives. There is no mention of prerequisites, conditions, or when to avoid using it. The description lacks any decision support for the agent.

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