Skip to main content
Glama

create_order

Place cryptocurrency trading orders including limit, take profit, and stop loss orders to execute trading strategies on supported blockchain networks.

Instructions

Create a order. Can be a limit, take profit or stop loss order.

Expects a CreateOrderRequestContainer, returns a CreateOrderResponseContainer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
create_order_requestsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
create_order_responsesYes

Implementation Reference

  • The primary MCP tool handler for 'create_order', registered via @mcp.tool(). It handles input validation via type hints, checks authentication, delegates to armor_client.create_order, and returns the response or error.
    @mcp.tool()
    async def create_order(create_order_requests: CreateOrderRequestContainer) -> CreateOrderResponseContainer:
        """
        Create a order. Can be a limit, take profit or stop loss order.
        
        Expects a CreateOrderRequestContainer, returns a CreateOrderResponseContainer.
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: CreateOrderResponseContainer = await armor_client.create_order(create_order_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Helper method in ArmorWalletAPIClient that implements the core logic: serializes the request container to payload and makes a POST API call to the Armor Wallet API endpoint for creating orders.
    async def create_order(self, data: CreateOrderRequestContainer) -> CreateOrderResponseContainer:
        """Create a order."""
        payload = data.model_dump(exclude_none=True)['create_order_requests']
        return await self._api_call("POST", "transactions/order/create/", payload)
  • Pydantic schema for a single CreateOrderRequest, defining fields like wallet, tokens, amount, duration, watch conditions for limit/take-profit/stop-loss orders.
    class CreateOrderRequest(BaseModel):
        wallet: str = Field(description="name of the wallet")
        input_token: str = Field(description="public address of the input token")
        output_token: str = Field(description="public address of the output token")
        amount: float = Field(description="amount of input token to invest")
        strategy_duration: int = Field(description="duration of the order")
        strategy_duration_unit: Literal["MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "YEAR"] = Field(description="unit of the duration of the order")
        watch_field: Literal["liquidity", "marketCap", "price"] = Field(description="field to watch to execute the order. Can be price, marketCap or liquidity")
        direction: Literal["ABOVE", "BELOW"] = Field(description="whether or not the order is above or below current market value")
        token_address_watcher: str = Field(description="public address of the token to watch. should be output token for limit orders and input token for stop loss and take profit orders")
        target_value: Optional[float] = Field(description="target value to execute the order. You must always specify a target value or delta percentage.")
        delta_percentage: Optional[float] = Field(description="delta percentage to execute the order. You must always specify a target value or delta percentage.")
  • Input container schema wrapping a list of CreateOrderRequest for batch processing in the MCP tool.
    class CreateOrderRequestContainer(BaseModel):
        create_order_requests: List[CreateOrderRequest]
  • Output container schema wrapping a list of OrderResponse from the API.
    class CreateOrderResponseContainer(BaseModel):
        create_order_responses: List[OrderResponse]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only mentions the input/output container types without behavioral details. It doesn't disclose permissions needed, rate limits, side effects (e.g., fund deductions), or error conditions, which are critical for a mutation tool like order creation.

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 brief and front-loaded with the core purpose, but the second sentence about input/output containers adds minimal value without elaboration. It avoids redundancy but could be more informative given the complexity.

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?

Given the tool's complexity (order creation with financial implications), no annotations, and 0% schema coverage, the description is incomplete. While an output schema exists, the description lacks crucial context like authentication needs, order constraints, or error handling, making it minimally adequate but with significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only names the parameter ('CreateOrderRequestContainer') without explaining its structure, required fields, or semantics. This fails to compensate for the lack of schema documentation, leaving the parameter meaning unclear.

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

Purpose3/5

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

The description states the tool creates an order and lists three specific types (limit, take profit, stop loss), which provides a clear verb and resource scope. However, it doesn't differentiate from sibling tools like 'create_dca_order' or 'cancel_order', leaving ambiguity about when to use this versus those alternatives.

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 like 'create_dca_order' or 'cancel_order'. The description only states what it does without context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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

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