Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_vault_balance

Retrieve current balance information for a specific vault on the Paradex platform, including available funds, locked funds, and total balance to assess financial state before trades or withdrawals.

Instructions

Get the current balance of a specific vault.

Retrieves the current balance information for a specific vault, including available funds, locked funds, and total balance. This is essential for understanding the financial state of a vault before executing trades or withdrawals.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main execution logic for the 'paradex_vault_balance' tool. Fetches vault balance data from Paradex API, validates it using Pydantic TypeAdapter, and returns list of VaultBalance objects.
    @server.tool(name="paradex_vault_balance")
    async def get_vault_balance(
        vault_address: Annotated[
            str, Field(description="The address of the vault to get balance for.")
        ],
    ) -> list[VaultBalance]:
        """
        Get the current balance of a specific vault.
    
        Retrieves the current balance information for a specific vault,
        including available funds, locked funds, and total balance.
        This is essential for understanding the financial state of a vault
        before executing trades or withdrawals.
    
        """
        try:
            client = await get_paradex_client()
            response = await api_call(client, "vaults/balance", params={"address": vault_address})
            if "error" in response:
                raise Exception(response["error"])
            results = response["results"]
            balances = vault_balance_adapter.validate_python(results)
            return balances
        except Exception as e:
            logger.error(f"Error fetching balance for vault {vault_address}: {e!s}")
            raise e
  • Pydantic BaseModel defining the structure and validation for VaultBalance output objects returned by the tool.
    class VaultBalance(BaseModel):
        """Model representing the balance of a vault."""
    
        token: Annotated[str, Field(description="Name of the token")]
        size: Annotated[str, Field(description="Balance amount of settlement token")]
        last_updated_at: Annotated[int, Field(description="Balance last updated time")]
  • The @server.tool decorator registers the get_vault_balance function as the MCP tool named 'paradex_vault_balance'.
    @server.tool(name="paradex_vault_balance")
  • Supporting resource endpoint that performs the actual API call to Paradex for vault balance data, invoked indirectly by the tool handler.
    @server.resource("paradex://vaults/balance/{vault_id}")
    async def get_vault_balance(vault_id: str) -> dict[str, Any]:
        """
        Get a summary of market information for a specific trading pair.
    
        This endpoint requires authentication and provides detailed
        information about the market, including order book, ticker, and
        market statistics.
    
        Args:
            market_id (str): The ID of the trading pair to get summary for.
    
        Returns:
            Dict[str, Any]: Summary of market information.
        """
        try:
            # Get market summary from Paradex
            client = await get_paradex_client()
            summary = await api_call(client, "vaults/balance", params={"address": vault_id})
            return summary
        except Exception as e:
            logger.error(f"Error fetching market summary: {e!s}")
            return {
                "success": False,
                "timestamp": datetime.now().isoformat(),
                "environment": config.ENVIRONMENT,
                "error": str(e),
                "summary": None,
            }
  • TypeAdapter for list[VaultBalance] used for input validation/parsing of the API response in the handler.
    vault_balance_adapter = TypeAdapter(list[VaultBalance])
Behavior2/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 mentions what information is retrieved ('available funds, locked funds, and total balance'), which adds some context. However, it doesn't describe key behavioral traits such as whether this is a read-only operation (implied by 'get' but not explicit), authentication requirements, rate limits, error conditions, or how the data is formatted in the output. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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: the first sentence states the core purpose, followed by elaboration and context. It uses three sentences efficiently, with no redundant information. However, the second sentence could be slightly more concise, and the structure is straightforward but not exceptionally polished.

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 (simple read operation with one parameter) and the presence of an output schema (which handles return values), the description is moderately complete. It covers the purpose and basic usage context but lacks details on behavioral aspects like authentication or error handling. With no annotations and an output schema, the description provides a foundation but doesn't fully address all contextual needs for a tool in a financial trading environment.

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?

The input schema has 100% description coverage, with the parameter 'vault_address' clearly documented in the schema. The description doesn't add any additional meaning beyond what the schema provides (e.g., it doesn't explain the format of the address or provide examples). Since schema coverage is high, the baseline score is 3, as the description doesn't compensate but also doesn't detract from the schema's documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Get the current balance of a specific vault' and 'Retrieves the current balance information for a specific vault'. It specifies the verb ('get', 'retrieves') and resource ('vault'), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'paradex_vault_summary' or 'paradex_vault_account_summary', which might offer overlapping or related information.

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

Usage Guidelines3/5

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

The description provides implied usage context: 'This is essential for understanding the financial state of a vault before executing trades or withdrawals.' This suggests when to use the tool (pre-trade or pre-withdrawal checks), but it doesn't explicitly state when not to use it or name specific alternatives among the sibling tools (e.g., 'paradex_vault_summary' might provide broader vault details). The guidance is helpful but lacks explicit exclusions or comparisons.

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