Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_orderbook

Analyze market depth and liquidity to optimize order entry and execution by retrieving orderbook data for Paradex perpetual futures markets.

Instructions

Analyze market depth and liquidity to optimize order entry and execution.

Use this tool when you need to:
- Assess true liquidity before placing large orders
- Identify potential support/resistance levels from order clusters
- Determine optimal limit order prices for higher fill probability
- Detect order imbalances that might signal price direction

Understanding the orderbook is essential for effective trade execution,
especially for larger orders or in less liquid markets.

Example use cases:
- Finding the optimal limit price to ensure your order gets filled
- Estimating potential slippage for market orders of different sizes
- Identifying large resting orders that might act as support/resistance
- Detecting order book imbalances that could predict short-term price moves

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get orderbook for.
depthNoThe depth of the orderbook to retrieve.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'paradex_orderbook' tool. It is registered via the @server.tool decorator and fetches the orderbook data from the Paradex client using the provided market_id and depth parameters.
    @server.tool(name="paradex_orderbook")
    async def get_orderbook(
        market_id: Annotated[str, Field(description="Market symbol to get orderbook for.")],
        depth: Annotated[
            int,
            Field(default=OrderbookDepth.MEDIUM, description="The depth of the orderbook to retrieve."),
        ],
        ctx: Context = None,
    ) -> dict[str, Any]:
        """
        Analyze market depth and liquidity to optimize order entry and execution.
    
        Use this tool when you need to:
        - Assess true liquidity before placing large orders
        - Identify potential support/resistance levels from order clusters
        - Determine optimal limit order prices for higher fill probability
        - Detect order imbalances that might signal price direction
    
        Understanding the orderbook is essential for effective trade execution,
        especially for larger orders or in less liquid markets.
    
        Example use cases:
        - Finding the optimal limit price to ensure your order gets filled
        - Estimating potential slippage for market orders of different sizes
        - Identifying large resting orders that might act as support/resistance
        - Detecting order book imbalances that could predict short-term price moves
        """
        try:
            # Get orderbook from Paradex
            client = await get_paradex_client()
            response = client.fetch_orderbook(market_id, params={"depth": depth})
            return response
        except Exception as e:
            await ctx.error(f"Error fetching orderbook for {market_id}: {e!s}")
            raise e

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "get_orderbookDictOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/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 communicates that this is a read-only analysis tool (implied by 'analyze' and 'assess'), describes its value for trade execution optimization, and mentions practical applications like slippage estimation. However, it doesn't explicitly state rate limits, authentication requirements, or data freshness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: a purpose statement, specific use cases in bullet points, and example applications. Every sentence adds value without redundancy. The front-loaded purpose statement immediately communicates the tool's function, followed by practical guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (market analysis with 2 parameters), the description provides excellent context about why and when to use it. With an output schema present, the description correctly focuses on purpose and usage rather than return values. The combination of purpose statement, usage guidelines, and example cases creates a complete picture for an AI agent.

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 thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. It focuses on the tool's purpose and usage rather than parameter details, which is appropriate given the comprehensive 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 as analyzing market depth and liquidity for order optimization, using specific verbs like 'analyze' and 'optimize'. It distinguishes from siblings like paradex_bbo (best bid/offer) and paradex_markets by focusing specifically on orderbook depth analysis rather than basic market data or execution actions.

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 with four bullet points covering specific scenarios like assessing liquidity before large orders, identifying support/resistance levels, determining optimal limit prices, and detecting order imbalances. It implicitly distinguishes from execution tools like paradex_create_order by focusing on analysis rather than order placement.

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