Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_vault_positions

Monitor active trading positions to track performance, manage risk, and assess liquidation prices and margin requirements for a vault.

Instructions

Monitor active trading positions to track performance and manage risk.

Use this tool when you need to:
- Get a complete view of all open positions for a vault
- Monitor unrealized P&L across all positions
- Check liquidation prices and margin requirements
- Assess position sizing and leverage across markets
- Track entry prices and position duration

Position monitoring is fundamental to risk management and provides
the necessary information for trade management decisions.

Example use cases:
- Checking the current status of all open trades
- Monitoring unrealized profit/loss across positions
- Assessing liquidation risk during market volatility
- Comparing performance across different markets
- Planning adjustments to position sizes or leverage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vault_addressYesThe address of the vault to get positions for.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function decorated with @server.tool(name="paradex_vault_positions"). It fetches vault positions from the Paradex API using get_paradex_client and api_call, validates with position_adapter, and returns the list of Position objects.
    @server.tool(name="paradex_vault_positions")
    async def get_vault_positions(
        vault_address: Annotated[
            str, Field(description="The address of the vault to get positions for.")
        ],
    ) -> list[Position]:
        """
        Monitor active trading positions to track performance and manage risk.
    
        Use this tool when you need to:
        - Get a complete view of all open positions for a vault
        - Monitor unrealized P&L across all positions
        - Check liquidation prices and margin requirements
        - Assess position sizing and leverage across markets
        - Track entry prices and position duration
    
        Position monitoring is fundamental to risk management and provides
        the necessary information for trade management decisions.
    
        Example use cases:
        - Checking the current status of all open trades
        - Monitoring unrealized profit/loss across positions
        - Assessing liquidation risk during market volatility
        - Comparing performance across different markets
        - Planning adjustments to position sizes or leverage
        """
        try:
            client = await get_paradex_client()
            response = await api_call(client, "vaults/positions", params={"address": vault_address})
            positions = position_adapter.validate_python(response["results"])
            return positions
        except Exception as e:
            logger.error(f"Error fetching positions for vault {vault_address}: {e!s}")
            raise e
  • Pydantic BaseModel defining the schema for individual Position objects returned by the tool. Used in position_adapter for list validation.
    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.",
            ),
        ]
  • The @server.tool decorator registers the get_vault_positions function as the MCP tool named 'paradex_vault_positions'.
    @server.tool(name="paradex_vault_positions")
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 what the tool does (monitoring/read-only operations) and provides rich context about the type of information returned (unrealized P&L, liquidation prices, margin requirements, entry prices, position duration). However, it doesn't mention potential limitations like rate limits or authentication requirements.

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, usage scenarios, rationale, examples) and efficiently communicates essential information. While slightly longer than minimal, every sentence adds value by clarifying use cases and context. The information is front-loaded with the core purpose stated first.

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 (position monitoring in a trading system), the description provides comprehensive context about what information is returned and how it should be used. With an output schema present, the description appropriately focuses on usage scenarios rather than return value details. The description adequately compensates for the lack of annotations.

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?

Schema description coverage is 100% for the single parameter 'vault_address', so the schema already documents it adequately. The description doesn't add specific parameter semantics beyond what's in the schema, but with only one parameter and high schema coverage, this is acceptable. The description provides context about what 'vault' means in this trading system.

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 'Monitor active trading positions to track performance and manage risk' with specific verbs ('monitor', 'track', 'manage') and resource ('trading positions'). It distinguishes from sibling tools like 'paradex_account_positions' by focusing specifically on vault positions rather than general account positions.

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 scenarios with a bulleted list of when to use this tool ('Get a complete view of all open positions for a vault', 'Monitor unrealized P&L', etc.) and includes example use cases that reinforce appropriate contexts. It implicitly distinguishes from sibling tools by focusing on vault-specific position monitoring.

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