Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_account_positions

Monitor open positions to analyze exposure, profitability, and risk for trading decisions. Check P&L, liquidation prices, and margin requirements across markets.

Instructions

Analyze your open positions to monitor exposure, profitability, and risk.

Use this tool when you need to:
- Check the status and P&L of all your open positions
- Monitor your liquidation prices and margin requirements
- Assess your exposure across different markets
- Make decisions about position management (scaling, hedging, closing)

Understanding your current positions is fundamental to proper risk management
and is the starting point for many trading decisions.

Example use cases:
- Checking the unrealized P&L of your positions
- Monitoring liquidation prices during market volatility
- Assessing total exposure across related assets
- Verifying entry prices and position sizes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the paradex_account_positions tool. It fetches the user's account positions using the authenticated Paradex client, validates the response with Pydantic, and returns a formatted result including the schema and positions data.
    @server.tool(name="paradex_account_positions")
    async def get_account_positions(ctx: Context) -> dict:
        """
        Analyze your open positions to monitor exposure, profitability, and risk.
    
        Use this tool when you need to:
        - Check the status and P&L of all your open positions
        - Monitor your liquidation prices and margin requirements
        - Assess your exposure across different markets
        - Make decisions about position management (scaling, hedging, closing)
    
        Understanding your current positions is fundamental to proper risk management
        and is the starting point for many trading decisions.
    
        Example use cases:
        - Checking the unrealized P&L of your positions
        - Monitoring liquidation prices during market volatility
        - Assessing total exposure across related assets
        - Verifying entry prices and position sizes
        """
        client = await get_authenticated_paradex_client()
        response = client.fetch_positions()
        if "error" in response:
            await ctx.error(response)
            raise Exception(response["error"])
        positions = position_adapter.validate_python(response["results"])
    
        results = {
            "description": Position.__doc__.strip() if Position.__doc__ else None,
            "fields": Position.model_json_schema(),
            "results": positions,
        }
        return results
  • Pydantic model defining the Position structure, used for validating the positions list returned by the Paradex API and generating the JSON schema in the tool response.
    class Position(BaseModel):
        """Position model representing a trading position on Paradex."""
    
        id: Annotated[str, Field(description="Unique string ID for the position")]
        account: Annotated[str, Field(description="Account ID of the position")]
        market: Annotated[str, Field(description="Market for position")]
        status: Annotated[
            str, Field(description="Status of Position : Open or Closed", enum=["OPEN", "CLOSED"])
        ]
        side: Annotated[str, Field(description="Position Side : Long or Short", enum=["SHORT", "LONG"])]
        size: Annotated[
            float,
            Field(description="Size of the position with sign (positive if long or negative if short)"),
        ]
        average_entry_price: Annotated[float, Field(description="Average entry price")]
        average_entry_price_usd: Annotated[float, Field(description="Average entry price in USD")]
        average_exit_price: Annotated[float, Field(description="Average exit price")]
        unrealized_pnl: Annotated[
            float, Field(description="Unrealized P&L of the position in the quote asset")
        ]
        unrealized_funding_pnl: Annotated[
            float, Field(description="Unrealized running funding P&L for the position")
        ]
        cost: Annotated[float, Field(description="Position cost")]
        cost_usd: Annotated[float, Field(description="Position cost in USD")]
        cached_funding_index: Annotated[float, Field(description="Position cached funding index")]
        last_updated_at: Annotated[int, Field(description="Position last update time")]
        last_fill_id: Annotated[
            str, Field(description="Last fill ID to which the position is referring")
        ]
        seq_no: Annotated[
            int,
            Field(
                description="Unique increasing number (non-sequential) that is assigned to this position update. Can be used to deduplicate multiple feeds"
            ),
        ]
        liquidation_price: Annotated[
            str, Field(default="", description="Liquidation price of the position")
        ]
        leverage: Annotated[float, Field(default=0, description="Leverage of the position")]
        realized_positional_pnl: Annotated[
            float,
            Field(
                default=0,
                description="Realized PnL including both positional PnL and funding payments. Reset to 0 when position is closed or flipped.",
            ),
        ]
        created_at: Annotated[int, Field(default=0, description="Position creation time")]
        closed_at: Annotated[int, Field(default=0, description="Position closed time")]
        realized_positional_funding_pnl: Annotated[
            str,
            Field(
                default="",
                description="Realized Funding PnL for the position. Reset to 0 when position is closed or flipped.",
            ),
        ]
  • Import of the tools module, which loads and registers all tool handlers via their @server.tool decorators, including paradex_account_positions.
    from mcp_paradex.tools import *
  • Pydantic TypeAdapter used to validate the list of positions from the API response.
    position_adapter = TypeAdapter(list[Position])
  • Helper function to obtain the authenticated ParadexApiClient instance, called by the tool handler.
    async def get_authenticated_paradex_client() -> ParadexApiClient:
        """
        Get or initialize the authenticated Paradex client.
    
        Returns:
            Paradex: The initialized Paradex client.
    
        Raises:
            ValueError: If the required configuration is not set.
        """
        client = await get_paradex_client()
        if client.account is None:
            raise ValueError("Paradex client is not authenticated")
        return client
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 this is a read-only analysis tool (implied by 'analyze', 'monitor', 'check') that provides position data for risk management and trading decisions. However, it doesn't mention potential limitations like data freshness, rate limits, or authentication requirements, leaving some behavioral aspects unspecified.

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 and front-loaded with the core purpose in the first sentence. Each subsequent section (usage scenarios, fundamental importance, example use cases) adds specific value without redundancy. The bullet points and clear organization make it efficient to parse while maintaining comprehensive coverage.

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 has no parameters and no output schema, the description provides excellent contextual completeness by explaining what the tool does, when to use it, and providing concrete examples. The only minor gap is the lack of information about return format or data structure, which would be helpful since there's no output schema, but the description otherwise covers the essential context thoroughly.

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?

The tool has zero parameters with 100% schema description coverage, so the baseline would be 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on the tool's purpose and usage context, which adds value beyond the empty schema.

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 ('analyze', 'monitor', 'assess') and resources ('open positions'), and distinguishes it from siblings by focusing on position analysis rather than fills, funding, orders, or other account aspects. The opening sentence 'Analyze your open positions to monitor exposure, profitability, and risk' provides immediate clarity.

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 explicitly lists four bullet points detailing when to use this tool ('Check the status and P&L', 'Monitor liquidation prices', 'Assess exposure', 'Make decisions about position management'), and includes example use cases that reinforce these scenarios. It clearly differentiates this from tools like paradex_account_fills or paradex_open_orders by focusing on position analysis rather than transaction history or order 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