get_all_orders
Retrieve a list of limit, take profit, and stop loss orders from the Armor Crypto MCP server. Filter results by status and specify the number of orders to return for efficient order management.
Instructions
Retrieve all limit, take profit and stop loss orders.
Returns a list of orders.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| get_all_orders_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:192-206 (handler)The main handler function for the 'get_all_orders' tool. It is registered via the @mcp.tool() decorator, performs authentication check, and delegates to armor_client.list_orders().@mcp.tool() async def get_all_orders(get_all_orders_requests: ListOrderRequest) -> ListOrderResponseContainer: """ Retrieve all limit, take profit and stop loss orders. Returns a list of orders. """ if not armor_client: return [{"error": "Not logged in"}] try: result: ListOrderResponseContainer = await armor_client.list_orders(get_all_orders_requests) return result except Exception as e: return [{"error": str(e)}]
- Pydantic schema for the input parameter ListOrderRequest used by the get_all_orders tool.class ListOrderRequest(BaseModel): status: Optional[Literal["OPEN", "CANCELLED", "EXPIRED", "COMPLETED", "FAILED", "IN_PROCESS"]] = Field(description="status of the orders, if specified filters results.") limit: Optional[int] = Field(default=30, description="number of most recent results to return")
- Pydantic schema for OrderResponse, the core element in the tool's output.class OrderResponse(BaseModel): id: str = Field(description="unique identifier of the order") amount: float = Field(description="amount of tokens to invest") status: str = Field(description="current status of the order") input_token_data: TokenData = Field(description="details of the input token") output_token_data: TokenData = Field(description="details of the output token") wallet_name: str = Field(description="name of the wallet") execution_type: Literal["LIMIT", "STOP_LOSS", "TAKE_PROFIT"] = Field(description="type of the order") expiry_time: str = Field(description="expiry time of the order in ISO format") watchers: List[OrderWatcher] = Field(description="list of watchers for the order") transaction: Optional[dict] = Field(description="transaction details if any", default=None) created: str = Field(description="ISO 8601 timestamp of the creation of the order")
- Pydantic schema for the output ListOrderResponseContainer wrapping list of OrderResponse.class ListOrderResponseContainer(BaseModel): list_order_responses: List[OrderResponse]
- Helper method in ArmorWalletAPIClient that performs the API call to list orders, invoked by the tool handler.async def list_orders(self, data: ListOrderRequest) -> ListOrderResponseContainer: """List all orders.""" payload = data.model_dump(exclude_none=True) return await self._api_call("POST", f"transactions/order/", payload)