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
| Name | Required | Description | Default |
|---|---|---|---|
| cancel_dca_order_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:450-463 (handler)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)