Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_markets

Find and analyze trading markets on Paradex by retrieving detailed specifications like tick sizes, minimum orders, and asset types to match your trading criteria.

Instructions

Find markets that match your trading criteria or get detailed market specifications.

Use this tool when you need to:
- Understand exact tick sizes and minimum order sizes before placing trades
- Find all markets for a specific asset (e.g., all BTC-based markets)
- Compare contract specifications across different markets
- Identify markets with specific characteristics for your trading strategy

Retrieves comprehensive details about specified markets, including
base and quote assets, tick size, minimum order size, and other
trading parameters. If "ALL" is specified or no market IDs are provided,
returns details for all available markets.

Example use cases:
- Finding the minimum order size for a new trade
- Identifying markets with the smallest tick size for precise entries
- Checking which assets are available for trading

`asset_kind` is the type of asset in the market. It can be `PERP` or `PERP_OPTION`.

You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results.
Use the `paradex_filters_model` tool to get the filters for a tool.
Examples:
- Filter by base asset: "[?base_asset=='BTC']"
- Sort by 24h volume: "sort_by([*], &volume_24h)"
- Limit to top 5 by volume: "[sort_by([*], &to_number(volume_24h))[-5:]]"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idsNoMarket symbols to get details for.
jmespath_filterNoJMESPath expression to filter, sort, or limit the results.
limitNoLimit the number of results to the specified number.
offsetNoOffset the results to the specified number.

Implementation Reference

  • The main handler function for the paradex_markets tool, decorated with @server.tool(name="paradex_markets"). Fetches market details from Paradex API, applies filtering by market IDs, JMESPath expressions, pagination (limit/offset), validates with Pydantic, sorts results, and returns a structured dictionary including schema and metadata.
    @server.tool(name="paradex_markets")
    async def get_markets(
        market_ids: Annotated[
            list[str], Field(description="Market symbols to get details for.", default=["ALL"])
        ],
        jmespath_filter: Annotated[
            str,
            Field(
                description="JMESPath expression to filter, sort, or limit the results.",
                default="",
            ),
        ],
        limit: Annotated[
            int,
            Field(
                default=10,
                gt=0,
                le=100,
                description="Limit the number of results to the specified number.",
            ),
        ],
        offset: Annotated[
            int,
            Field(
                default=0,
                ge=0,
                description="Offset the results to the specified number.",
            ),
        ],
        ctx: Context = None,
    ) -> dict:
        """
        Find markets that match your trading criteria or get detailed market specifications.
    
        Use this tool when you need to:
        - Understand exact tick sizes and minimum order sizes before placing trades
        - Find all markets for a specific asset (e.g., all BTC-based markets)
        - Compare contract specifications across different markets
        - Identify markets with specific characteristics for your trading strategy
    
        Retrieves comprehensive details about specified markets, including
        base and quote assets, tick size, minimum order size, and other
        trading parameters. If "ALL" is specified or no market IDs are provided,
        returns details for all available markets.
    
        Example use cases:
        - Finding the minimum order size for a new trade
        - Identifying markets with the smallest tick size for precise entries
        - Checking which assets are available for trading
    
        `asset_kind` is the type of asset in the market. It can be `PERP` or `PERP_OPTION`.
    
        You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results.
        Use the `paradex_filters_model` tool to get the filters for a tool.
        Examples:
        - Filter by base asset: "[?base_asset=='BTC']"
        - Sort by 24h volume: "sort_by([*], &volume_24h)"
        - Limit to top 5 by volume: "[sort_by([*], &to_number(volume_24h))[-5:]]"
        """
        try:
            client = await get_paradex_client()
    
            response = client.fetch_markets()
            if "error" in response:
                await ctx.error(response)
                raise Exception(response["error"])
            details = market_details_adapter.validate_python(response["results"])
            if market_ids and "ALL" not in market_ids:
                details = [detail for detail in details if detail.symbol in market_ids]
    
            # Apply JMESPath filter if provided
            if jmespath_filter:
                details = apply_jmespath_filter(
                    data=details,
                    jmespath_filter=jmespath_filter,
                    type_adapter=market_details_adapter,
                    error_logger=ctx.error if ctx else None,
                )
            sorted_details = sorted(details, key=lambda x: x.symbol, reverse=True)
            result_details = sorted_details[offset : offset + limit]
            result = {
                "description": MarketDetails.__doc__.strip() if MarketDetails.__doc__ else None,
                "fields": MarketDetails.model_json_schema(),
                "results": result_details,
                "total": len(sorted_details),
                "limit": limit,
                "offset": offset,
            }
            return result
        except Exception as e:
            await ctx.error(f"Error fetching market details: {e!s}")
            raise e
  • Pydantic BaseModel MarketDetails used for input validation of API responses and defining the output schema structure for market details in the paradex_markets tool results. Referenced via MarketDetails.model_json_schema() in the handler.
    class MarketDetails(BaseModel):
        """Model representing the details of a market."""
    
        symbol: Annotated[str, Field(default="", description="Market symbol")]
        base_currency: Annotated[str, Field(default="", description="Base currency of the market")]
        quote_currency: Annotated[str, Field(default="", description="Quote currency of the market")]
        settlement_currency: Annotated[
            str, Field(default="", description="Settlement currency of the market")
        ]
        order_size_increment: Annotated[
            str, Field(default="", description="Minimum size increment for base currency")
        ]
        price_tick_size: Annotated[
            float, Field(default=0.0, description="Minimum price increment of the market in USD")
        ]
        min_notional: Annotated[float, Field(default=0.0, description="Minimum order size in USD")]
        open_at: Annotated[int, Field(default=0, description="Market open time in milliseconds")]
        expiry_at: Annotated[int, Field(default=0, description="Market expiry time")]
        asset_kind: Annotated[
            str, Field(default="", description="Type of asset", examples=["PERP", "PERP_OPTION"])
        ]
        market_kind: Annotated[str, Field(default="", description="Type of market - always 'cross'")]
        position_limit: Annotated[float, Field(default=0.0, description="Position limit")]
        price_bands_width: Annotated[
            float,
            Field(
                default=0.0,
                description="Price Bands Width, 0.05 means 5% price deviation allowed from mark price",
            ),
        ]
        max_open_orders: Annotated[int, Field(default=0, description="Max open orders")]
        max_funding_rate: Annotated[float, Field(default=0.0, description="Max funding rate")]
        delta1_cross_margin_params: Annotated[
            dict[str, float], Field(default_factory=dict, description="Delta1 Cross margin parameters")
        ]
        option_cross_margin_params: Annotated[
            dict[str, dict[str, float]],
            Field(default_factory=dict, description="Option Cross margin parameters"),
        ]
        price_feed_id: Annotated[
            str,
            Field(
                default="",
                description="Price feed id. Pyth price account used to price underlying asset",
            ),
        ]
        oracle_ewma_factor: Annotated[float, Field(default=0.0, description="Oracle EWMA factor")]
        max_order_size: Annotated[
            float, Field(default=0.0, description="Maximum order size in base currency")
        ]
        max_funding_rate_change: Annotated[
            float, Field(default=0.0, description="Max funding rate change")
        ]
        max_tob_spread: Annotated[
            float,
            Field(
                default=0.0, description="The maximum TOB spread allowed to apply funding rate changes"
            ),
        ]
        interest_rate: Annotated[float, Field(default=0.0, description="Interest rate")]
        clamp_rate: Annotated[float, Field(default=0.0, description="Clamp rate")]
        funding_period_hours: Annotated[int, Field(default=0, description="Funding period in hours")]
        tags: Annotated[list[str], Field(default_factory=list, description="Market tags")]
        option_type: Annotated[str, Field(default="", description="Type of option (PUT or CALL)")]
        strike_price: Annotated[float, Field(default=0.0, description="Strike price for option market")]
        iv_bands_width: Annotated[float, Field(default=0.0, description="IV Bands Width")]
  • The @server.tool decorator registers the get_markets function as the MCP tool named 'paradex_markets'.
    @server.tool(name="paradex_markets")
  • TypeAdapter for list[MarketDetails] used to validate the raw API response data in the handler.
    market_details_adapter = TypeAdapter(list[MarketDetails])
  • Reference to MarketDetails.model_json_schema() in the get_filters_model tool, providing the output schema for paradex_markets.
    "paradex_markets": models.MarketDetails.model_json_schema(),
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: the tool retrieves comprehensive market details, explains the 'ALL' default behavior, mentions specific data fields returned (base/quote assets, tick size, minimum order size), and provides guidance on result filtering via JMESPath. It doesn't mention rate limits or authentication requirements, but covers the core operational behavior well.

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, behavioral details, parameter explanations, and examples. While comprehensive, some redundancy exists (e.g., JMESPath explanation appears twice). Most sentences earn their place by providing distinct value, though it could be slightly more concise in the examples section.

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?

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description provides substantial context. It covers purpose, usage scenarios, behavioral details, parameter semantics, and includes practical examples. The main gap is the lack of output format description, but this is partially compensated by mentioning specific data fields returned. For a read-only query tool, this is quite complete.

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

Parameters4/5

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

With 100% schema description coverage, the baseline is 3. The description adds significant value by explaining the practical meaning of parameters: it clarifies that 'market_ids' defaults to 'ALL' for all markets, provides concrete examples of JMESPath usage for filtering/sorting/limiting, and explains the purpose of filtering through use cases. However, it doesn't explain the 'limit' and 'offset' parameters beyond what the schema provides.

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 ('find markets', 'get detailed market specifications') and distinguishes it from siblings by focusing on market discovery and specification retrieval rather than account operations, trading, or system functions. The opening sentence provides a concise summary of the dual functionality.

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 guidance on when to use this tool through a bulleted list of specific scenarios (e.g., 'Understand exact tick sizes', 'Find all markets for a specific asset', 'Compare contract specifications'). It also distinguishes use cases from sibling tools by focusing on market research rather than trading execution or account management.

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

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