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])
Behavior3/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 the tool's behavior (retrieving details, handling large result sets with filtering) and provides practical guidance on using JMESPath expressions. However, it lacks information on potential rate limits, authentication requirements, or error conditions that would be important for a tool dealing with potentially large datasets.

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 appropriately sized. It front-loads the core purpose, follows with detailed behavior explanation, then provides practical usage guidance with examples. While comprehensive, every sentence serves a clear purpose, though the JMESPath examples section is somewhat lengthy but necessary for clarity.

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 (4 parameters, no output schema, no annotations), the description does a reasonable job but has gaps. It explains the tool's behavior and parameter usage well, but lacks information about return format, pagination behavior (beyond limit/offset parameters), error handling, or performance considerations for large datasets. The absence of an output schema increases the need for more complete behavioral description.

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?

With 100% schema description coverage, the baseline is 3. The description adds significant value beyond the schema by explaining the practical implications of parameters: it clarifies that vault_address being empty returns all vaults, emphasizes jmespath_filter's importance for managing large result sets, and provides concrete examples of JMESPath usage that go beyond the schema's basic description.

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 like paradex_vault_summary or paradex_vault_balance by emphasizing detailed information retrieval rather than summaries or specific data subsets.

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 for usage: 'if no address is provided' to get all vaults, and advises using jmespath_filter to reduce results 'as number of vaults can be large'. However, it does not explicitly mention when to use this tool versus alternatives like paradex_vault_summary or paradex_vault_account_summary, which could help differentiate use cases.

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