Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_create_order

Execute trades on Paradex with precise control over order parameters, including limit, stop-loss, take-profit, and conditional orders for risk management and strategy implementation.

Instructions

Execute trades on Paradex with precise control over all order parameters.

Use this tool when you need to:
- Enter a new position based on your trading strategy
- Set limit orders at specific price levels
- Create stop-loss or take-profit orders for risk management
- Implement complex trading strategies with conditional orders

This is the primary tool for executing your trading decisions on Paradex,
with full control over order type, size, price, and execution parameters.

Example use cases:
- Setting limit orders at key support/resistance levels
- Placing stop-limit orders to manage risk on existing positions
- Executing market orders for immediate entry or exit
- Creating reduce-only orders to ensure you don't flip position direction

Succesful response indicates that orders were queued for execution.
Check order status using order id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket identifier.
order_sideYesOrder side.
order_typeYesOrder type.
sizeYesOrder size.
priceYesOrder price (required for LIMIT orders).
trigger_priceYesTrigger price for stop limit orders.
instructionNoInstruction for order execution.GTC
reduce_onlyNoReduce-only flag.
client_idYesClient-specified order ID.

Implementation Reference

  • The primary handler function for the 'paradex_create_order' tool. It constructs an Order object from parameters, submits it using the Paradex client, and returns the resulting OrderState.
    @server.tool(name="paradex_create_order")
    async def create_order(
        market_id: Annotated[str, Field(description="Market identifier.")],
        order_side: Annotated[OrderSideEnum, Field(description="Order side.")],
        order_type: Annotated[OrderTypeEnum, Field(description="Order type.")],
        size: Annotated[float, Field(description="Order size.")],
        price: Annotated[float, Field(description="Order price (required for LIMIT orders).")],
        trigger_price: Annotated[float, Field(description="Trigger price for stop limit orders.")],
        instruction: Annotated[
            InstructionEnum, Field(default="GTC", description="Instruction for order execution.")
        ],
        reduce_only: Annotated[bool, Field(default=False, description="Reduce-only flag.")],
        client_id: Annotated[str, Field(description="Client-specified order ID.")],
        ctx: Context = None,
    ) -> dict:
        """
        Execute trades on Paradex with precise control over all order parameters.
    
        Use this tool when you need to:
        - Enter a new position based on your trading strategy
        - Set limit orders at specific price levels
        - Create stop-loss or take-profit orders for risk management
        - Implement complex trading strategies with conditional orders
    
        This is the primary tool for executing your trading decisions on Paradex,
        with full control over order type, size, price, and execution parameters.
    
        Example use cases:
        - Setting limit orders at key support/resistance levels
        - Placing stop-limit orders to manage risk on existing positions
        - Executing market orders for immediate entry or exit
        - Creating reduce-only orders to ensure you don't flip position direction
    
        Succesful response indicates that orders were queued for execution.
        Check order status using order id.
        """
        client = await get_authenticated_paradex_client()
        o = Order(
            market=market_id,
            order_side=OrderSide(order_side),
            order_type=OrderType(order_type),
            size=Decimal(str(size)),
            client_id=client_id,
            limit_price=Decimal(str(price)) if price else Decimal(0),
            reduce_only=reduce_only,
            instruction=instruction,
            trigger_price=Decimal(str(trigger_price)) if trigger_price else None,
        )
        response = client.submit_order(o)
        order: OrderState = OrderState(**response)
        result = {
            "description": OrderState.__doc__.strip() if OrderState.__doc__ else None,
            "fields": OrderState.model_json_schema(),
            "results": order,
        }
        return result
  • Enum types (OrderTypeEnum, InstructionEnum, OrderSideEnum) used for input parameter validation in the paradex_create_order handler.
    # Define allowed order types
    OrderTypeEnum = Literal[
        "MARKET",
        "LIMIT",
        "STOP_LIMIT",
        "STOP_MARKET",
        "TAKE_PROFIT_LIMIT",
        "TAKE_PROFIT_MARKET",
        "STOP_LOSS_MARKET",
        "STOP_LOSS_LIMIT",
    ]
    
    # Define allowed instruction types
    InstructionEnum = Literal["GTC", "IOC", "POST_ONLY"]
    OrderSideEnum = Literal["BUY", "SELL"]
  • Pydantic model OrderState used for parsing and serializing the order response in the tool's output.
    class OrderState(BaseModel):
        """Order state model representing the current state of an order on Paradex."""
    
        id: Annotated[str, Field(description="Unique order identifier generated by Paradex")]
        account: Annotated[str, Field(description="Paradex Account")]
        market: Annotated[str, Field(description="Market")]
        side: Annotated[str, Field(description="Order side")]
        type: Annotated[str, Field(description="Order type")]
        size: Annotated[float, Field(description="Order size")]
        remaining_size: Annotated[float, Field(description="Remaining size of the order")]
        price: Annotated[float, Field(description="Order price. 0 for MARKET orders")]
        status: Annotated[str, Field(description="Order status")]
        created_at: Annotated[int, Field(description="Order creation time")]
        last_updated_at: Annotated[
            int, Field(description="Order last update time. No changes once status=CLOSED")
        ]
        timestamp: Annotated[int, Field(description="Order signature timestamp")]
        cancel_reason: Annotated[
            str, Field(description="Reason for order cancellation if it was closed by cancel")
        ]
        client_id: Annotated[
            str, Field(description="Client order id provided by the client at order creation")
        ]
        seq_no: Annotated[
            int,
            Field(
                description="Unique increasing number that is assigned to this order update and changes on every order update"
            ),
        ]
        instruction: Annotated[str, Field(description="Execution instruction for order matching")]
        avg_fill_price: Annotated[str, Field(description="Average fill price of the order")]
        stp: Annotated[str, Field(description="Self Trade Prevention mode")]
        received_at: Annotated[
            int, Field(description="Timestamp in milliseconds when order was received by API service")
        ]
        published_at: Annotated[
            int, Field(description="Timestamp in milliseconds when order was sent to the client")
        ]
        flags: Annotated[list[str], Field(description="Order flags, allow flag: REDUCE_ONLY")]
        trigger_price: Annotated[str, Field(description="Trigger price for stop order")]
  • Helper function that provides the authenticated ParadexApiClient instance used by the handler to submit orders.
    async def get_authenticated_paradex_client() -> ParadexApiClient:
        """
        Get or initialize the authenticated Paradex client.
    
        Returns:
            Paradex: The initialized Paradex client.
    
        Raises:
            ValueError: If the required configuration is not set.
        """
        client = await get_paradex_client()
        if client.account is None:
            raise ValueError("Paradex client is not authenticated")
        return client
  • The @server.tool decorator registers the create_order function as the MCP tool named 'paradex_create_order'.
    @server.tool(name="paradex_create_order")
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it's for executing trades (implying mutation/write operations), successful response means orders are queued for execution (not immediate), and users should check order status separately. It mentions risk management aspects but doesn't cover authentication needs, rate limits, or error conditions.

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 well-structured with clear sections: purpose statement, usage guidelines, primary function, example use cases, and response behavior. It's appropriately sized for a complex trading tool, though the example use cases section could be more concise as some examples overlap with the usage guidelines.

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

Completeness4/5

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

For a complex trading execution tool with 9 parameters, 100% schema coverage, but no annotations or output schema, the description provides good context. It covers purpose, usage scenarios, behavioral expectations, and response interpretation. However, it doesn't address potential errors, authentication requirements, or provide more detail on the queued execution process mentioned.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal parameter semantics beyond the schema - it mentions 'full control over order type, size, price, and execution parameters' and gives example use cases that imply parameter combinations, but doesn't provide additional syntax or format details. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the tool's purpose as executing trades on Paradex with precise control over order parameters. It uses specific verbs like 'execute trades' and 'enter a new position' and distinguishes itself from sibling tools by being the primary execution tool, unlike read-only tools like paradex_account_positions or paradex_open_orders.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines with a bulleted list of when to use this tool (entering positions, setting limit orders, creating stop-loss/take-profit orders, implementing complex strategies). It also distinguishes from alternatives by stating this is the primary tool for execution decisions, implying other tools are for monitoring or analysis.

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/sv/mcp-paradex-py'

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