Skip to main content
Glama
armorwallet
by armorwallet

cancel_dca_order

Cancel DCA (Dollar-Cost Averaging) orders using a specific order ID. Supports single or multiple order cancellations for streamlined crypto trading management.

Instructions

Create a DCA order.

Note: Make a single or multiple dca_order_requests 

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cancel_dca_order_requestsYes

Implementation Reference

  • The main MCP tool handler for 'cancel_dca_order', decorated with @mcp.tool(). It validates input using Pydantic models, checks authentication, calls the ArmorWalletAPIClient method, and handles errors.
    @mcp.tool()
    async def cancel_dca_order(cancel_dca_order_requests: CancelDCAOrderRequestContainer) -> List[CancelDCAOrderResponse]:
        """
        Create a DCA order.
    
        Note: Make a single or multiple dca_order_requests 
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: List[CancelDCAOrderResponse] = await armor_client.cancel_dca_order(cancel_dca_order_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Pydantic models defining the input (CancelDCAOrderRequest) and output (CancelDCAOrderResponse) structures for the cancel_dca_order tool.
    class CancelDCAOrderRequest(BaseModel):
        dca_order_id: str = Field(description="id of the DCA order")
    
    
    class CancelDCAOrderResponse(BaseModel):
        dca_order_id: str = Field(description="id of the DCA order")
        status: str = Field(description="status of the DCA order")
  • Container model for batch requests to cancel multiple DCA orders, used in the tool handler signature.
    class CancelDCAOrderRequestContainer(BaseModel):
        cancel_dca_order_requests: List[CancelDCAOrderRequest]
  • The ArmorWalletAPIClient method that performs the actual API call to cancel DCA orders via POST to /transactions/dca-order/cancel/.
    async def cancel_dca_order(self, data: CancelDCAOrderRequestContainer) -> List[CancelDCAOrderResponse]:
        """Cancel a DCA order."""
        # payload = [v.model_dump() for v in data.cancel_dca_order_requests]
        payload = data.model_dump(exclude_none=True)['cancel_dca_order_requests']
        return await self._api_call("POST", "transactions/dca-order/cancel/", payload)

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/armorwallet/armor-crypto-mcp'

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