Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_account_fills

Analyze executed trades to evaluate performance, calculate average entry prices, track realized PnL, and verify order execution details for reconciliation.

Instructions

Analyze your executed trades to evaluate performance and execution quality.

Use this tool when you need to:
- Review your trading history across specific markets
- Calculate your average entry price for multi-fill positions
- Analyze execution quality compared to intended prices
- Track realized PnL from completed trades
- Verify order execution details for reconciliation

Detailed fill information is essential for performance analysis and
understanding how your orders were actually executed.

Example use cases:
- Calculating volume-weighted average price (VWAP) of your entries
- Analyzing execution slippage from your intended prices
- Reviewing trade history for tax or accounting purposes
- Tracking commission costs across different markets
- Identifying which of your strategies produced the best execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesFilter by market ID.
start_unix_msYesStart time in unix milliseconds.
end_unix_msYesEnd time in unix milliseconds.

Implementation Reference

  • The main handler function for the paradex_account_fills tool. It authenticates a Paradex client, fetches fills filtered by market and time range, validates the response using TypeAdapter(list[Fill]), and returns a structured dictionary with schema and results.
    @server.tool(name="paradex_account_fills")
    async def get_account_fills(
        market_id: Annotated[str, Field(description="Filter by market ID.")],
        start_unix_ms: Annotated[int, Field(description="Start time in unix milliseconds.")],
        end_unix_ms: Annotated[int, Field(description="End time in unix milliseconds.")],
        ctx: Context = None,
    ) -> dict:
        """
        Analyze your executed trades to evaluate performance and execution quality.
    
        Use this tool when you need to:
        - Review your trading history across specific markets
        - Calculate your average entry price for multi-fill positions
        - Analyze execution quality compared to intended prices
        - Track realized PnL from completed trades
        - Verify order execution details for reconciliation
    
        Detailed fill information is essential for performance analysis and
        understanding how your orders were actually executed.
    
        Example use cases:
        - Calculating volume-weighted average price (VWAP) of your entries
        - Analyzing execution slippage from your intended prices
        - Reviewing trade history for tax or accounting purposes
        - Tracking commission costs across different markets
        - Identifying which of your strategies produced the best execution
        """
        client = await get_authenticated_paradex_client()
        params = {"market": market_id, "start_at": start_unix_ms, "end_at": end_unix_ms}
        response = client.fetch_fills(params)
        if "error" in response:
            await ctx.error(response)
            raise Exception(response["error"])
        fills = fill_adapter.validate_python(response["results"])
        results = {
            "description": Fill.__doc__.strip() if Fill.__doc__ else None,
            "fields": Fill.model_json_schema(),
            "results": fills,
        }
        return results
  • Pydantic BaseModel defining the structure and validation for Fill objects returned by the tool.
    class Fill(BaseModel):
        """Fill model representing a trade fill on Paradex."""
    
        id: Annotated[str, Field(description="Unique string ID of fill per FillType")]
        side: Annotated[str, Field(description="Taker side")]
        liquidity: Annotated[str, Field(description="Maker or Taker")]
        market: Annotated[str, Field(description="Market name")]
        order_id: Annotated[str, Field(description="Order ID")]
        price: Annotated[float, Field(description="Price at which order was filled")]
        size: Annotated[float, Field(description="Size of the fill")]
        fee: Annotated[float, Field(description="Fee paid by the user")]
        fee_currency: Annotated[str, Field(description="Asset that fee is charged in")]
        created_at: Annotated[int, Field(description="Fill time")]
        remaining_size: Annotated[float, Field(description="Remaining size of the order")]
        client_id: Annotated[str, Field(description="Unique client assigned ID for the order")]
        fill_type: Annotated[str, Field(description="Fill type, can be FILL, LIQUIDATION or TRANSFER")]
        realized_pnl: Annotated[float, Field(description="Realized PnL of the fill")]
        realized_funding: Annotated[float, Field(description="Realized funding of the fill")]
        account: Annotated[str, Field(default="", description="Account that made the fill")]
        underlying_price: Annotated[
            str, Field(default="", description="Underlying asset price of the fill (spot price)")
        ]
  • The @server.tool decorator registers the get_account_fills function as the MCP tool named paradex_account_fills.
    @server.tool(name="paradex_account_fills")
  • TypeAdapter for validating lists of Fill models in the tool response.
    fill_adapter = TypeAdapter(list[Fill])
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining this is a read-only analysis tool for historical data (not real-time), essential for performance analysis and reconciliation. It doesn't mention rate limits or authentication requirements, but covers the core behavioral purpose adequately.

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 a clear purpose statement followed by specific use cases and examples. While slightly longer than minimal, every sentence adds value by clarifying different aspects of when and how to use the tool, with no redundant information.

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?

For a read-only analysis tool with 3 well-documented parameters and no output schema, the description provides excellent context about what information the tool returns (execution details, prices, PnL, commissions) and how to interpret the results. It could mention the return format, but otherwise covers the essential context well.

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%, providing clear documentation for all three parameters. The description doesn't add any parameter-specific information beyond what's in the schema, but the schema already fully documents market_id, start_unix_ms, and end_unix_ms parameters, meeting the baseline expectation.

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 executed trades for performance and execution quality evaluation. It specifies the exact resource (executed trades) and distinguishes from siblings like paradex_account_positions (current holdings) and paradex_orders_history (order history) by focusing specifically on fill-level execution details.

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 in a bulleted list, including when to use it (review trading history, calculate average entry prices, analyze execution quality, track realized PnL, verify order execution) and distinguishes it from alternatives by focusing on executed trades rather than open positions or order status.

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/sv/mcp-paradex-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server