Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_market_summaries

Retrieve current market summaries to identify active or volatile markets, compare prices and volumes, and analyze market conditions for trading opportunities using JMESPath filtering.

Instructions

Identify the most active or volatile markets and get current market conditions.

Use this tool when you need to:
- Find the most active markets by volume for liquidity analysis
- Discover markets with significant price movements for momentum strategies
- Compare current prices across multiple assets
- Identify markets with unusual behavior for potential opportunities

Retrieves current market summary information including price, volume,
24h change, and other key market metrics. If "ALL" is specified or no market IDs
are provided, returns summaries for all available markets.

Example use cases:
- Finding high-volatility markets for short-term trading
- Identifying top gainers and losers for the day
- Comparing volume across different markets to find liquidity
- Getting the current price and 24-hour range for price analysis

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 high price: "[?high_price > `10000`]"
- Sort by volume: "sort_by([*], &volume)"
- Get top 3 by price change: "[sort_by([*], &to_number(price_change_percent))[-3:]]"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idsNoMarket symbols to get summaries 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 core handler function for 'paradex_market_summaries' tool. Fetches market summaries from Paradex API using client.fetch_markets_summary(), validates with MarketSummary models, applies optional JMESPath filtering/pagination, and returns paginated results with schema info.
    @server.tool(name="paradex_market_summaries")
    async def get_market_summaries(
        market_ids: Annotated[
            list[str], Field(description="Market symbols to get summaries for.", default=["ALL"])
        ],
        jmespath_filter: Annotated[
            str,
            Field(
                description="JMESPath expression to filter, sort, or limit the results.",
                default=None,
            ),
        ],
        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:
        """
        Identify the most active or volatile markets and get current market conditions.
    
        Use this tool when you need to:
        - Find the most active markets by volume for liquidity analysis
        - Discover markets with significant price movements for momentum strategies
        - Compare current prices across multiple assets
        - Identify markets with unusual behavior for potential opportunities
    
        Retrieves current market summary information including price, volume,
        24h change, and other key market metrics. If "ALL" is specified or no market IDs
        are provided, returns summaries for all available markets.
    
        Example use cases:
        - Finding high-volatility markets for short-term trading
        - Identifying top gainers and losers for the day
        - Comparing volume across different markets to find liquidity
        - Getting the current price and 24-hour range for price analysis
    
        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 high price: "[?high_price > `10000`]"
        - Sort by volume: "sort_by([*], &volume)"
        - Get top 3 by price change: "[sort_by([*], &to_number(price_change_percent))[-3:]]"
        """
        try:
            # Get market summary from Paradex
            client = await get_paradex_client()
            response = client.fetch_markets_summary(params={"market": "ALL"})
            if "error" in response:
                await ctx.error(response)
                raise Exception(response["error"])
    
            # Try to validate directly now that the model is more flexible
            summaries = market_summary_adapter.validate_python(response["results"])
    
            if market_ids and "ALL" not in market_ids:
                summaries = [summary for summary in summaries if summary.symbol in market_ids]
    
            # Apply JMESPath filter if provided
            if jmespath_filter:
                summaries = apply_jmespath_filter(
                    data=summaries,
                    jmespath_filter=jmespath_filter,
                    type_adapter=market_summary_adapter,
                    error_logger=ctx.error if ctx else None,
                )
            sorted_summaries = sorted(summaries, key=lambda x: x.symbol, reverse=True)
            result_summaries = sorted_summaries[offset : offset + limit]
            result = {
                "description": MarketSummary.__doc__.strip() if MarketSummary.__doc__ else None,
                "fields": MarketSummary.model_json_schema(),
                "results": result_summaries,
                "total": len(sorted_summaries),
                "limit": limit,
                "offset": offset,
            }
            return result
        except Exception as e:
            logger.error(f"Error fetching market summaries: {e!s}")
            await ctx.error(f"Error fetching market summaries: {e!s}")
            raise e
  • Pydantic model defining the structure and validation for individual MarketSummary objects used in the tool's response.
    class MarketSummary(BaseModel):
        """Model representing a summary of a market."""
    
        symbol: Annotated[str, Field(default="", description="Market symbol")]
        mark_price: Annotated[str, Field(default="", description="Mark price")]
        delta: Annotated[str, Field(default="", description="Deprecated: Use greeks.delta instead")]
        greeks: Annotated[
            Greeks,
            Field(
                default=None, description="Greeks (delta, gamma, vega). Partial for perpetual futures"
            ),
        ]
        last_traded_price: Annotated[str, Field(default="", description="Last traded price")]
        bid: Annotated[str, Field(default="", description="Best bid price")]
        ask: Annotated[str, Field(default="", description="Best ask price")]
        volume_24h: Annotated[str, Field(default="", description="24 hour volume in USD")]
        total_volume: Annotated[
            str, Field(default="", description="Lifetime total traded volume in USD")
        ]
        created_at: Annotated[int, Field(default=0, description="Market summary creation time")]
        underlying_price: Annotated[
            str, Field(default="", description="Underlying asset price (spot price)")
        ]
        open_interest: Annotated[str, Field(default="", description="Open interest in base currency")]
        funding_rate: Annotated[str, Field(default="", description="8 hour funding rate")]
        price_change_rate_24h: Annotated[
            str, Field(default="", description="Price change rate in the last 24 hours")
        ]
  • The @server.tool decorator registers the get_market_summaries function as the MCP tool named 'paradex_market_summaries'.
    @server.tool(name="paradex_market_summaries")
  • Provides the JSON schema for paradex_market_summaries via model_json_schema() in the get_filters_model tool, used for client-side validation/filtering info.
        "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]
  • TypeAdapter for validating lists of MarketSummary objects returned from the API.
    market_summary_adapter = TypeAdapter(list[MarketSummary])

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
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 retrieves current market data (implying read-only), specifies that it returns summaries for all markets if 'ALL' or no IDs are given, and mentions JMESPath filtering capabilities. However, it lacks details on rate limits, error handling, or data freshness, leaving some 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 well-structured and front-loaded with purpose and usage guidelines. However, it includes repetitive elements (e.g., similar points in usage lists and example use cases) and could be more concise by merging overlapping sections. Most sentences are valuable, but some trimming would improve efficiency.

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 complexity (4 parameters, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, parameters, and filtering, but lacks details on output structure (e.g., what fields are returned) and potential limitations like pagination or data latency. This is adequate but has minor gaps.

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. The description adds some context by explaining the default behavior with 'ALL' market IDs and providing JMESPath examples, but it doesn't add significant meaning beyond what the schema provides (e.g., no extra syntax or format details). This meets the baseline for high schema coverage.

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 ('identify', 'get', 'retrieves') and resources ('markets', 'market summary information'). It distinguishes itself from sibling tools by focusing on market summaries rather than account data, orders, or other market functions, making its scope explicit.

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, listing four specific scenarios (e.g., 'Find the most active markets by volume', 'Discover markets with significant price movements'). It also includes example use cases and references an alternative tool ('paradex_filters_model') for filtering, offering clear context for application.

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