Skip to main content
Glama

delete_coupon

Remove a discount coupon from Hotmart by providing its coupon ID.

Instructions

Delete Coupon

Exclui um cupom de desconto.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coupon_idYesID do cupom

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the delete_coupon tool. Makes a DELETE request to /products/api/v1/coupon/{coupon_id} using the shared Hotmart client and returns the JSON response.
    async def delete_coupon(
        coupon_id: int,
    ) -> str:
        """Delete Coupon
        
        Exclui um cupom de desconto.
        
        Args:
            coupon_id: ID do cupom"""
        endpoint = f"/products/api/v1/coupon/{coupon_id}"
        result = await get_client().delete(endpoint)
        return json.dumps(result, indent=2)
  • Input schema: expects a single 'coupon_id' integer parameter.
    async def delete_coupon(
        coupon_id: int,
    ) -> str:
  • Auto-discovery registers delete_coupon (an async function) as an MCP tool by iterating modules and calling mcp.tool()(obj).
    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
  • Helper that provides the shared HotmartClient singleton used by delete_coupon to make the DELETE HTTP 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 must carry the burden. It only states the action 'delete' without disclosing consequences (e.g., irreversible, cascading effects, required permissions). The agent lacks crucial behavioral context.

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

Conciseness4/5

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

The description is very short, consisting of two lines in English and Portuguese. It is efficient but could be more concise by focusing on a single language. No wasted sentences.

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?

The tool has an output schema, so return values are not required in the description. However, the description does not mention what happens upon success or failure, or any side effects. It is minimally acceptable for a simple delete.

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 covers 100% of the parameter (coupon_id) with a basic description. The tool's description does not add any additional meaning or context beyond what is already in the schema.

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

Purpose5/5

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

The description clearly states the tool's action ('Delete Coupon') and resource (coupon). The Portuguese line reinforces the intent. It is specific and distinguishes from other tools like create_coupon or get_coupons.

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 versus alternatives, such as when a coupon should be deleted or if it has dependencies that prohibit deletion. No context or exclusions are mentioned.

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