Skip to main content
Glama
diaorui

Jupiter Perps MCP Server

by diaorui

estimate_open_position

Calculate fees and projected position details before opening or increasing a leveraged perpetual futures trade on Jupiter, including liquidation price and total collateral.

Instructions

Estimates fees and resulting position state for opening a new position or increasing an existing one. Returns: (1) fees_to_pay - fees for THIS trade only: open fee, price impact fee, and any accrued borrow fees that will be settled; (2) resulting_position - final state AFTER trade: weighted average entry price, total size, total collateral, leverage, and liquidation price. Does NOT execute the trade. Important: total_collateral_usd includes protocol-specific factors beyond visible fees: (a) USDC price typically ~$0.9997-1.0003, not exactly $1.00; (b) Long positions incur additional swap costs (~0.05%) when converting USDC to the borrowed asset; (c) rounding/slippage. Short positions generally match calculations more closely as they borrow USDC directly. Note: The Jupiter protocol returns slightly lower leverage than requested, with larger differences at higher leverage (e.g., 10x → 9.99x, 100x → 99.47x).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYesThe asset to trade
sideYesDirection of the trade
collateral_amountYesAmount of USDC to use as collateral (minimum: 10 USD, must be <= wallet balance)
leverageYesLeverage multiplier (added size = collateral * leverage)
Behavior5/5

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

With no annotations provided, the description carries full burden and delivers comprehensive behavioral disclosure. It explains what the tool returns (fees_to_pay and resulting_position with detailed breakdowns), warns about protocol-specific factors affecting calculations (USDC price variance, swap costs for long positions, rounding/slippage), and discloses Jupiter protocol's leverage approximation behavior. This goes well beyond basic functionality description.

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 with the core purpose. Every sentence adds value: first states purpose and returns, second clarifies non-execution, third explains protocol-specific factors, fourth details differences between long/short positions, fifth discloses leverage approximation. While comprehensive, it could be slightly more concise in the protocol factors section.

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 complexity of financial position estimation with no annotations and no output schema, the description provides exceptional completeness. It thoroughly explains what the tool returns, behavioral characteristics, protocol-specific nuances, and important caveats. This gives the agent sufficient context to understand the tool's behavior and limitations despite the absence of structured output documentation.

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%, so the baseline is 3. The description adds significant value by explaining how parameters interact with the estimation: it clarifies that 'collateral_amount' is in USDC and mentions minimum requirements, and it explains how 'leverage' affects calculations ('added size = collateral * leverage') and the protocol's approximation behavior. However, it doesn't provide additional context for 'asset' or 'side' beyond what the schema already documents.

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 specific action ('Estimates fees and resulting position state') and distinguishes it from execution ('Does NOT execute the trade'). It explicitly differentiates from the sibling 'open_position' tool by emphasizing this is a simulation/preview tool rather than an execution tool.

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 guidance on when to use this tool: for estimating fees and position state 'for opening a new position or increasing an existing one.' It clearly distinguishes from the sibling 'open_position' by stating 'Does NOT execute the trade,' and the context of fee/state estimation before actual execution is well-defined.

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/diaorui/jupiter-perps-mcp'

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