Skip to main content
Glama
armorwallet
by armorwallet

cancel_order

Cancel limit, take profit, or stop loss orders in crypto trading through Armor Crypto MCP. Submit a CancelOrderRequestContainer to execute order cancellations efficiently.

Instructions

Cancel a limit, take profit or stop loss order.

Expects a CancelOrderRequestContainer, returns a CancelOrderResponseContainer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cancel_order_requestsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cancel_order_responsesYes

Implementation Reference

  • Primary MCP tool handler for 'cancel_order', registered with @mcp.tool(). Proxies to ArmorWalletAPIClient.cancel_order after input validation.
    @mcp.tool()
    async def cancel_order(cancel_order_requests: CancelOrderRequestContainer) -> CancelOrderResponseContainer:
        """
        Cancel a limit, take profit or stop loss order.
        
        Expects a CancelOrderRequestContainer, returns a CancelOrderResponseContainer.
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: CancelOrderResponseContainer = await armor_client.cancel_order(cancel_order_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Pydantic model defining the input structure for a single cancel order request (order_id).
    class CancelOrderRequest(BaseModel):
        order_id: str = Field(description="id of the limit order")
  • Pydantic model defining the response structure for a canceled order (order_id and status).
    class CancelOrderResponse(BaseModel):
        order_id: str = Field(description="id of the limit order")
        status: str = Field(description="status of the limit order")
  • Container Pydantic model for batching multiple CancelOrderRequest objects as input to the tool.
    class CancelOrderRequestContainer(BaseModel):
        cancel_order_requests: List[CancelOrderRequest]
  • Core implementation in ArmorWalletAPIClient that serializes the request and makes the HTTP POST to the /transactions/order/cancel/ API endpoint.
    async def cancel_order(self, data: CancelOrderRequestContainer) -> CancelOrderResponseContainer:
        """Cancel a order."""
        payload = data.model_dump(exclude_none=True)['cancel_order_requests']
        return await self._api_call("POST", "transactions/order/cancel/", payload) 
Behavior2/5

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

With no annotations, the description carries full burden but only states basic input/output types. It doesn't disclose critical behavioral traits like permissions needed, side effects (e.g., order removal), rate limits, or error conditions, leaving significant gaps for a mutation tool.

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 action, but the second sentence is somewhat redundant as it repeats schema info without adding context. Overall, it's efficient with minor waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations, 0% schema coverage, and an output schema, the description is inadequate. It lacks details on behavior, parameters, and usage context, failing to provide sufficient guidance despite the output schema covering return values.

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%, so the description must compensate but adds minimal value. It mentions 'CancelOrderRequestContainer' without explaining its structure or the 'order_id' parameter's semantics, failing to clarify what the single parameter entails beyond the schema.

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

Purpose4/5

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

The description clearly states the verb ('cancel') and resource ('limit, take profit or stop loss order'), making the purpose specific. It distinguishes from siblings like 'cancel_dca_order' by specifying order types, though not explicitly contrasting them.

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 on when to use this tool versus alternatives like 'cancel_dca_order' or 'create_order' is provided. The description implies usage for canceling specific order types but lacks explicit context, prerequisites, or exclusions.

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

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

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