Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_vaults

Retrieve detailed information about specific vaults or all vaults on the Paradex platform, including configuration, permissions, and parameters, with filtering options to manage large datasets.

Instructions

Get detailed information about a specific vault or all vaults if no address is provided.

Retrieves comprehensive details about a specific vault identified by its address,
including configuration, permissions, and other vault-specific parameters.

Use jmespath_filter to reduce the number of results as much as possible as number of vaults can be large.

You can use JMESPath expressions to filter, sort, or limit the results.
Examples:
- Filter by owner: "[?owner_account=='0x123...']"
- Filter by status: "[?status=='ACTIVE']"
- Find vaults with specific strategy: "[?contains(strategies, 'strategy_id')]"
- Sort by creation date: "sort_by([*], &created_at)"
- Limit to newest vaults: "sort_by([*], &created_at)[-5:]"
- Select specific fields: "[*].{address: address, name: name, kind: kind, status: status}"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vault_addressNoThe address of the vault to get details for or empty string to get all vaults.
jmespath_filterNoJMESPath expression to filter, sort, or limit the results.
limitNoLimit the number of results to the specified number.
offsetNoOffset the results to the specified number.

Implementation Reference

  • The primary handler function for the 'paradex_vaults' tool. It fetches vault data from the Paradex API, validates it using Pydantic TypeAdapter(list[Vault]), applies optional JMESPath filtering, sorts by creation date, applies pagination, and returns a structured response including the schema and metadata.
    @server.tool(name="paradex_vaults")
    async def get_vaults(
        vault_address: Annotated[
            str,
            Field(
                default="",
                description="The address of the vault to get details for or empty string to get all vaults.",
            ),
        ],
        jmespath_filter: Annotated[
            str,
            Field(
                default=None, description="JMESPath expression to filter, sort, or limit the results."
            ),
        ],
        limit: Annotated[
            int,
            Field(
                default=10,
                gt=0,
                le=100,
                description="Limit the number of results to the specified number.",
            ),
        ],
        offset: Annotated[
            int,
            Field(
                default=0,
                ge=0,
                description="Offset the results to the specified number.",
            ),
        ],
    ) -> dict:
        """
        Get detailed information about a specific vault or all vaults if no address is provided.
    
        Retrieves comprehensive details about a specific vault identified by its address,
        including configuration, permissions, and other vault-specific parameters.
    
        Use jmespath_filter to reduce the number of results as much as possible as number of vaults can be large.
    
        You can use JMESPath expressions to filter, sort, or limit the results.
        Examples:
        - Filter by owner: "[?owner_account=='0x123...']"
        - Filter by status: "[?status=='ACTIVE']"
        - Find vaults with specific strategy: "[?contains(strategies, 'strategy_id')]"
        - Sort by creation date: "sort_by([*], &created_at)"
        - Limit to newest vaults: "sort_by([*], &created_at)[-5:]"
        - Select specific fields: "[*].{address: address, name: name, kind: kind, status: status}"
        """
        try:
            client = await get_paradex_client()
            params = {"address": vault_address} if vault_address else None
            response = await api_call(client, "vaults", params=params)
            if "error" in response:
                raise Exception(response["error"])
            results = response["results"]
            vaults = vault_adapter.validate_python(results)
    
            # Apply JMESPath filter if provided
            if jmespath_filter:
                vaults = apply_jmespath_filter(
                    data=vaults,
                    jmespath_filter=jmespath_filter,
                    type_adapter=vault_adapter,
                    error_logger=logger.error,
                )
            sorted_vaults = sorted(vaults, key=lambda x: x.created_at, reverse=True)
            result_vaults = sorted_vaults[offset : offset + limit]
            result = {
                "description": Vault.__doc__.strip() if Vault.__doc__ else None,
                "fields": Vault.model_json_schema(),
                "vaults": result_vaults,
                "total": len(sorted_vaults),
                "limit": limit,
                "offset": offset,
            }
            return result
        except Exception as e:
            logger.error(f"Error fetching vault details: {e!s}")
            raise e
  • Pydantic model 'Vault' that defines the structure, types, and descriptions for vault data. Used by the tool for output validation and schema generation via Vault.model_json_schema().
    class Vault(BaseModel):
        """Vault model representing a trading vault on Paradex."""
    
        address: Annotated[str, Field(default="", description="Contract address of the vault")]
        name: Annotated[str, Field(default="", description="Name of the vault")]
        description: Annotated[str, Field(default="", description="Description of the vault")]
        owner_account: Annotated[str, Field(default="", description="Owner account of the vault")]
        operator_account: Annotated[str, Field(default="", description="Operator account of the vault")]
        strategies: Annotated[
            list[str], Field(default_factory=list, description="Strategies of the vault")
        ]
        token_address: Annotated[str, Field(default="", description="LP token address")]
        status: Annotated[str, Field(default="", description="Status of the vault")]
        kind: Annotated[
            str,
            Field(
                default="",
                description="Kind of the vault: 'user' for user-defined vaults, 'protocol' for vaults controlled by Paradex",
            ),
        ]
        profit_share: Annotated[
            int,
            Field(default=0, description="Profit share of the vault in percentage, i.e. 10 means 10%"),
        ]
        lockup_period: Annotated[
            int, Field(default=0, description="Lockup period of the vault in days")
        ]
        max_tvl: Annotated[
            int, Field(default=0, description="Maximum amount of assets the vault can hold in USDC")
        ]
        created_at: Annotated[
            int,
            Field(
                default=0,
                description="Unix timestamp in milliseconds of when the vault has been created",
            ),
        ]
        last_updated_at: Annotated[
            int,
            Field(
                default=0,
                description="Unix timestamp in milliseconds of when the vault was last updated",
            ),
        ]
  • Helper tool 'get_filters_model' that returns the JSON schema for 'paradex_vaults' (Vault.model_json_schema()) to help users build precise JMESPath filters.
    tool_descriptions = {
        "paradex_markets": models.MarketDetails.model_json_schema(),
        "paradex_market_summaries": models.MarketSummary.model_json_schema(),
        "paradex_open_orders": models.OrderState.model_json_schema(),
        "paradex_orders_history": models.OrderState.model_json_schema(),
        "paradex_vaults": models.Vault.model_json_schema(),
        "paradex_vault_summary": models.VaultSummary.model_json_schema(),
    }
    return tool_descriptions[tool_name]
  • Tool registration decorator @server.tool(name="paradex_vaults") that registers the get_vaults function as an MCP tool.
    @server.tool(name="paradex_vaults")
  • TypeAdapter for list[Vault] used to validate API response data in the paradex_vaults handler.
    vault_adapter = TypeAdapter(list[Vault])

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
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 of behavioral disclosure. It describes the tool as a read operation ('Get', 'Retrieves'), which implies non-destructive behavior, and mentions that the number of vaults can be large, hinting at performance considerations. However, it lacks details on permissions, rate limits, error handling, or response format, which are important for a tool with no output schema.

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 appropriately sized and front-loaded, starting with the core purpose and usage. The JMESPath examples are helpful but slightly lengthy; however, they earn their place by providing practical guidance. Overall, it is efficient with minimal waste, though it could be slightly more streamlined.

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 complexity (4 parameters, no annotations, no output schema), the description is moderately complete. It covers purpose, usage, and parameter semantics well, but lacks behavioral details like response structure, error cases, or authentication needs. Without an output schema, more information on return values would be beneficial, though the description does hint at result formats through examples.

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 input schema has 100% description coverage, so the baseline is 3. The description adds value by explaining the semantics of vault_address (specific vault vs. all vaults) and jmespath_filter (with examples for filtering, sorting, and limiting). It also implies usage of limit and offset for result management, though not explicitly detailed. This compensates well beyond the 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 ('Get detailed information', 'Retrieves comprehensive details') and resources ('vault' or 'all vaults'). It distinguishes this tool from siblings by focusing on vault details rather than account summaries, balances, positions, or transfers, which are covered by other tools like paradex_vault_summary, paradex_vault_balance, paradex_vault_positions, and paradex_vault_transfers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use the tool: for a specific vault (with address) or all vaults (if no address). It also advises using jmespath_filter to reduce results due to potentially large numbers of vaults. However, it does not explicitly state when not to use this tool or name specific alternatives among siblings, such as paradex_vault_summary for less detailed information.

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