Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_cancel_orders

Cancel pending orders to manage trading exposure, adjust strategies, or respond to market changes. Remove specific orders by ID or clear all orders across markets.

Instructions

Cancel pending orders to manage exposure or adjust your trading strategy. Use this tool when you need to: - Remove stale limit orders that are no longer desirable - Quickly reduce market exposure during volatility - Update your order strategy by removing existing orders - Clear your order book before implementing a new strategy - React to changing market conditions by canceling pending orders Order cancellation is a critical risk management function and allows you to quickly adapt to changing market conditions. Example use cases: - Canceling limit orders when your outlook changes - Removing all orders during unexpected market volatility - Canceling a specific order identified by order ID - Clearing all orders for a specific market - Removing stale orders before placing new ones Calling without any parameters will cancel all orders. Succesful response indicates that orders were queued for cancellation. Check order status using order id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idNoOrder id (received from create_order)
client_idNoClient id (provided by you on create_order)
market_idNoMarket is the market to cancel orders forALL

Implementation Reference

  • The handler function for the 'paradex_cancel_orders' tool. It cancels Paradex orders by order_id, client_id, or all orders in a market using the authenticated Paradex client. Includes input schema via Annotated fields and returns an OrderState object.
    @server.tool(name="paradex_cancel_orders") async def cancel_orders( order_id: Annotated[ str, Field(default="", description="Order id (received from create_order)") ], client_id: Annotated[ str, Field(default="", description="Client id (provided by you on create_order)") ], market_id: Annotated[ str, Field(default="ALL", description="Market is the market to cancel orders for") ], ctx: Context = None, ) -> OrderState: """ Cancel pending orders to manage exposure or adjust your trading strategy. Use this tool when you need to: - Remove stale limit orders that are no longer desirable - Quickly reduce market exposure during volatility - Update your order strategy by removing existing orders - Clear your order book before implementing a new strategy - React to changing market conditions by canceling pending orders Order cancellation is a critical risk management function and allows you to quickly adapt to changing market conditions. Example use cases: - Canceling limit orders when your outlook changes - Removing all orders during unexpected market volatility - Canceling a specific order identified by order ID - Clearing all orders for a specific market - Removing stale orders before placing new ones Calling without any parameters will cancel all orders. Succesful response indicates that orders were queued for cancellation. Check order status using order id. """ client = await get_authenticated_paradex_client() if order_id: response = client.cancel_order(order_id) elif client_id: response = client.cancel_order_by_client_id(client_id) elif market_id: response = client.cancel_all_orders(market_id) else: raise Exception("Either order_id or client_id must be provided.") order = OrderState(**response) return 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/sv/mcp-paradex-py'

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