Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_orders_history

Retrieve and analyze historical orders, including filled, canceled, and expired trades, to evaluate past trading activity and performance.

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
end_unix_msYesEnd time in unix milliseconds.
market_idYesFilter by market.
start_unix_msYesStart time in unix milliseconds.

Implementation Reference

  • The main handler function for the paradex_orders_history tool. It authenticates a Paradex client, fetches historical orders with specified parameters, validates the response using OrderState model adapter, and returns a formatted result dictionary.
    @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 registration for the paradex_orders_history tool within the paradex_filters_model tool, referencing models.OrderState.model_json_schema() for input/output 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(), } return tool_descriptions[tool_name]

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

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