Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_bbo

Retrieve current best bid and ask prices for immediate trading decisions, spread calculations, and real-time market condition monitoring.

Instructions

Get the current best available prices for immediate execution decisions.

Use this tool when you need to:
- Make quick trading decisions without full orderbook depth
- Calculate current spread costs before placing orders
- Monitor real-time price changes efficiently
- Get a snapshot of current market conditions
- Determine fair mid-price for calculations

The BBO provides the most essential price information with minimal data,
perfect for quick decisions or when full orderbook depth isn't needed.

Example use cases:
- Calculating current trading spreads before placing orders
- Monitoring real-time price movements efficiently
- Determining execution prices for immediate market orders
- Calculating mid-price for order placement strategies
- Setting appropriate limit order prices to improve fill chances

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get BBO for.

Implementation Reference

  • Handler function for paradex_bbo tool. Fetches BBO data from Paradex client, validates with BBO model, and formats response with schema.
    @server.tool(name="paradex_bbo")
    async def get_bbo(
        market_id: Annotated[str, Field(description="Market symbol to get BBO for.")],
        ctx: Context = None,
    ) -> dict:
        """
        Get the current best available prices for immediate execution decisions.
    
        Use this tool when you need to:
        - Make quick trading decisions without full orderbook depth
        - Calculate current spread costs before placing orders
        - Monitor real-time price changes efficiently
        - Get a snapshot of current market conditions
        - Determine fair mid-price for calculations
    
        The BBO provides the most essential price information with minimal data,
        perfect for quick decisions or when full orderbook depth isn't needed.
    
        Example use cases:
        - Calculating current trading spreads before placing orders
        - Monitoring real-time price movements efficiently
        - Determining execution prices for immediate market orders
        - Calculating mid-price for order placement strategies
        - Setting appropriate limit order prices to improve fill chances
        """
        try:
            # Get BBO from Paradex
            client = await get_paradex_client()
            response = client.fetch_bbo(market_id)
            bbo = BBO(**response)
            results = {
                "description": BBO.__doc__.strip() if BBO.__doc__ else None,
                "fields": BBO.model_json_schema(),
                "results": bbo,
            }
            return results
        except Exception as e:
            await ctx.error(f"Error fetching BBO for {market_id}: {e!s}")
            raise e
  • Pydantic model defining the input/output schema for BBO data used by the paradex_bbo tool.
    class BBO(BaseModel):
        """Best Bid and Offer model for a market."""
    
        market: Annotated[str, Field(description="Symbol of the market")]
        seq_no: Annotated[int, Field(description="Sequence number of the orderbook")]
        ask: Annotated[float, Field(description="Best ask price")]
        ask_size: Annotated[float, Field(description="Best ask size")]
        bid: Annotated[float, Field(description="Best bid price")]
        bid_size: Annotated[float, Field(description="Best bid size")]
        last_updated_at: Annotated[
            int, Field(description="Last update to the orderbook in milliseconds")
        ]
  • Registration of the paradex_bbo tool using the @server.tool decorator.
    @server.tool(name="paradex_bbo")
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses behavioral traits such as providing 'real-time price changes' and 'minimal data' for efficiency, but lacks details on rate limits, authentication needs, or specific return formats. It adequately describes the tool's function but misses deeper operational context.

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 the core purpose, followed by usage guidelines and examples. It is appropriately sized, but could be slightly more concise by avoiding repetition in the example use cases, which echo earlier points. Overall, it efficiently conveys key information.

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 complexity (a real-time price query), no annotations, and no output schema, the description is moderately complete. It covers purpose and usage well but lacks details on output format, error handling, or behavioral constraints like latency or data freshness, which are important for trading contexts.

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?

The input schema has 100% description coverage, with 'market_id' clearly documented. The description does not add parameter semantics beyond the schema, as it focuses on usage and context rather than parameter details. With high schema coverage, the baseline score of 3 is appropriate.

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: 'Get the current best available prices for immediate execution decisions.' It specifies the verb ('Get') and resource ('current best available prices'), and distinguishes it from sibling tools like 'paradex_orderbook' by emphasizing minimal data for quick decisions versus full orderbook depth.

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 usage guidelines, listing specific scenarios when to use this tool (e.g., 'Make quick trading decisions without full orderbook depth') and implicitly when not to use it (when full depth is needed). It also distinguishes it from alternatives by noting it's 'perfect for quick decisions or when full orderbook depth isn't needed,' contrasting with tools like 'paradex_orderbook'.

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