Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_orders_history

Retrieve historical orders for trading analysis, including filled, canceled, and expired orders from the Paradex perpetual futures platform.

Instructions

Get historical orders.

Retrieves the history of orders for the account, including filled, canceled, and expired orders. This is useful for analyzing past trading activity and performance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesFilter by market.
start_unix_msYesStart time in unix milliseconds.
end_unix_msYesEnd time in unix milliseconds.

Implementation Reference

  • The main handler function for the paradex_orders_history tool. It fetches historical orders from the Paradex client based on market, start time, and end time parameters, validates them using OrderState model, and returns a structured result.
    @server.tool(name="paradex_orders_history")
    async def get_orders_history(
        market_id: Annotated[str, Field(description="Filter by market.")],
        start_unix_ms: Annotated[int, Field(description="Start time in unix milliseconds.")],
        end_unix_ms: Annotated[int, Field(description="End time in unix milliseconds.")],
        ctx: Context = None,
    ) -> dict:
        """
        Get historical orders.
    
        Retrieves the history of orders for the account, including filled, canceled, and expired orders.
        This is useful for analyzing past trading activity and performance.
        """
        client = await get_authenticated_paradex_client()
        params = {"market": market_id, "start_at": start_unix_ms, "end_at": end_unix_ms}
        # Remove None values from params
        params = {k: v for k, v in params.items() if v is not None}
        response = client.fetch_orders_history(params=params)
        if "error" in response:
            await ctx.error(response)
            raise Exception(response["error"])
        orders_raw: list[dict[str, Any]] = response["results"]
        orders = order_state_adapter.validate_python(orders_raw)
        result = {
            "description": OrderState.__doc__.strip() if OrderState.__doc__ else None,
            "fields": OrderState.model_json_schema(),
            "results": orders,
        }
        return result
  • Schema mapping for paradex_orders_history tool in the get_filters_model function, referencing OrderState.model_json_schema() for output type definition and validation.
    tool_descriptions = {
        "paradex_markets": models.MarketDetails.model_json_schema(),
        "paradex_market_summaries": models.MarketSummary.model_json_schema(),
        "paradex_open_orders": models.OrderState.model_json_schema(),
        "paradex_orders_history": models.OrderState.model_json_schema(),
        "paradex_vaults": models.Vault.model_json_schema(),
        "paradex_vault_summary": models.VaultSummary.model_json_schema(),
    }
  • The @server.tool decorator registers the paradex_orders_history tool with the MCP server.
    @server.tool(name="paradex_orders_history")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves historical orders but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what format the data comes in. For a read operation with no annotation coverage, this leaves significant gaps.

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 appropriately concise with three sentences that each add value: stating the purpose, specifying order types, and explaining usefulness. It's front-loaded with the core function and wastes no words, though it could be slightly more structured with explicit usage boundaries.

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 moderate complexity (historical data retrieval with three required parameters), no annotations, and no output schema, the description is minimally adequate. It covers what the tool does but lacks details about authentication requirements, response format, pagination, or error handling that would be needed for full contextual understanding.

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 three parameters (market_id, start_unix_ms, end_unix_ms) with their descriptions. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score when schema does the heavy lifting.

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 tool's purpose as 'Get historical orders' and specifies it retrieves order history including filled, canceled, and expired orders. It distinguishes itself from sibling tools like paradex_open_orders (current orders) and paradex_account_fills (executed trades), though it doesn't explicitly name these alternatives.

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

Usage Guidelines3/5

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

The description implies usage for analyzing past trading activity and performance, suggesting when this tool is appropriate. However, it doesn't provide explicit guidance on when to use this versus alternatives like paradex_account_fills or paradex_open_orders, nor does it mention any prerequisites or exclusions.

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