Skip to main content
Glama

get_all_orders

Retrieve all limit, take profit, and stop loss orders from cryptocurrency trading operations to monitor and manage active trading positions.

Instructions

Retrieve all limit, take profit and stop loss orders. Returns a list of orders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
get_all_orders_requestsYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the get_all_orders tool by delegating to armor_client.list_orders with authentication check and error handling.
    @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 model defining the input schema for get_all_orders tool: optional status filter and limit.
    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 model defining the output schema container for the tool response: list of OrderResponse objects.
    class ListOrderResponseContainer(BaseModel): list_order_responses: List[OrderResponse]
  • Supporting method in ArmorWalletAPIClient that performs the actual API call to list orders using the input request.
    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)
  • Detailed Pydantic model for individual OrderResponse used 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")

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

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