Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_order_status

Check and monitor the execution status of specific orders on the Paradex platform to verify fills, confirm cancellations, and diagnose placement issues.

Instructions

Check the detailed status of a specific order for execution monitoring.

Use this tool when you need to:
- Confirm if a particular order was accepted and is active
- Check if an order has been filled, partially filled, or canceled
- Get execution details for a specific order
- Diagnose issues with order placement
- Track the status of important orders individually

Order status tracking is essential for verifying execution status
and troubleshooting any issues with specific orders.

Example use cases:
- Checking if a recently placed limit order is active in the book
- Verifying fill details of a specific order
- Determining why an order might have been rejected
- Confirming cancellation status of an order you attempted to cancel
- Getting execution timestamps for order lifecycle analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder identifier.
client_idYesClient-specified order ID.

Implementation Reference

  • Decorator that registers the get_order_status function as the MCP tool named 'paradex_order_status'.
    @server.tool(name="paradex_order_status")
  • The core handler function that implements the paradex_order_status tool logic. It authenticates the Paradex client, fetches the order by ID or client ID, validates the response using OrderState, and returns a standardized dictionary with schema and results.
    async def get_order_status(
        order_id: Annotated[str, Field(description="Order identifier.")],
        client_id: Annotated[str, Field(description="Client-specified order ID.")],
        ctx: Context = None,
    ) -> dict:
        """
        Check the detailed status of a specific order for execution monitoring.
    
        Use this tool when you need to:
        - Confirm if a particular order was accepted and is active
        - Check if an order has been filled, partially filled, or canceled
        - Get execution details for a specific order
        - Diagnose issues with order placement
        - Track the status of important orders individually
    
        Order status tracking is essential for verifying execution status
        and troubleshooting any issues with specific orders.
    
        Example use cases:
        - Checking if a recently placed limit order is active in the book
        - Verifying fill details of a specific order
        - Determining why an order might have been rejected
        - Confirming cancellation status of an order you attempted to cancel
        - Getting execution timestamps for order lifecycle analysis
        """
        client = await get_authenticated_paradex_client()
        if order_id:
            response = client.fetch_order(order_id)
        elif client_id:
            response = client.fetch_order_by_client_id(client_id)
        else:
            raise Exception("Either order_id or client_id must be provided.")
        order: OrderState = OrderState.model_validate(response)
        result = {
            "description": OrderState.__doc__.strip() if OrderState.__doc__ else None,
            "fields": OrderState.model_json_schema(),
            "results": order,
        }
        return result
  • Pydantic BaseModel defining the structure and validation for order status data returned by the Paradex API. Used for input validation and output schema generation in the tool response.
    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")]
  • Utility function that provides the authenticated ParadexApiClient instance used by the tool handler to make API calls like fetch_order.
    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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/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 the tool's purpose and use cases but lacks details about authentication requirements, rate limits, error conditions, or response format. The description doesn't contradict annotations (none exist), but doesn't provide comprehensive behavioral context beyond the core functionality.

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, usage scenarios, importance statement, examples) and front-loads the core purpose. While somewhat verbose with multiple bullet points, each sentence serves a distinct purpose in clarifying usage context, making it efficient rather than wasteful.

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 read-only status check tool with 2 parameters and 100% schema coverage but no output schema, the description provides substantial contextual completeness through detailed usage scenarios and examples. It effectively explains when and why to use this tool, though it could benefit from mentioning response format or error handling to reach full completeness.

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 both parameters (order_id and client_id) adequately. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for high schema coverage situations.

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 with specific verbs ('check', 'get', 'track') and resource ('detailed status of a specific order'), distinguishing it from siblings like paradex_open_orders (list open orders) and paradex_orders_history (historical orders). It explicitly focuses on individual order monitoring rather than batch operations.

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 when-to-use guidance with a bulleted list of five specific scenarios (e.g., 'Confirm if a particular order was accepted', 'Diagnose issues with order placement'), plus example use cases that clarify context. It implicitly distinguishes from siblings by focusing on individual order status rather than account-level or market data tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.