Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Commit 09c7943

Browse files
committed
Update Paradex integration to MCP 1.8.1 and enhance documentation for various tools and APIs.
1 parent e9d76a9 commit 09c7943

8 files changed

Lines changed: 363 additions & 98 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,4 @@ contribute to this project, development setup, and our coding standards.
285285

286286
## License
287287

288-
[MIT License](LICENSE)
288+
[MIT License](LICENSE)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "MCP server for Paradex trading platform integration"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8-
"mcp[cli]>=1.7.1",
8+
"mcp[cli]>=1.8.1",
99
"paradex-py>=0.4.3",
1010
"pydantic>=2.10.6",
1111
"uvicorn>=0.34.0",

src/mcp_paradex/tools/account.py

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,22 @@
1515
@server.tool(name="paradex_account_summary")
1616
async def get_account_summary(ctx: Context) -> AccountSummary:
1717
"""
18-
Get account summary.
19-
18+
Get a snapshot of your account's current financial status and trading capacity.
19+
20+
Use this tool when you need to:
21+
- Check your current available and total balance
22+
- Understand your margin utilization and remaining trading capacity
23+
- Verify your account health and distance from liquidation
24+
- Get an overview of realized and unrealized P&L
25+
26+
This provides the essential financial information needed to make informed
27+
trading decisions and manage risk appropriately.
28+
29+
Example use cases:
30+
- Checking available balance before placing new orders
31+
- Monitoring account health during volatile market conditions
32+
- Assessing realized and unrealized P&L for performance tracking
33+
- Verifying margin requirements and utilization
2034
"""
2135
client = await get_authenticated_paradex_client()
2236
response = await api_call(client, "account")
@@ -29,7 +43,22 @@ async def get_account_summary(ctx: Context) -> AccountSummary:
2943
@server.tool(name="paradex_account_positions")
3044
async def get_account_positions(ctx: Context) -> dict:
3145
"""
32-
Get account positions.
46+
Analyze your open positions to monitor exposure, profitability, and risk.
47+
48+
Use this tool when you need to:
49+
- Check the status and P&L of all your open positions
50+
- Monitor your liquidation prices and margin requirements
51+
- Assess your exposure across different markets
52+
- Make decisions about position management (scaling, hedging, closing)
53+
54+
Understanding your current positions is fundamental to proper risk management
55+
and is the starting point for many trading decisions.
56+
57+
Example use cases:
58+
- Checking the unrealized P&L of your positions
59+
- Monitoring liquidation prices during market volatility
60+
- Assessing total exposure across related assets
61+
- Verifying entry prices and position sizes
3362
"""
3463
client = await get_authenticated_paradex_client()
3564
response = client.fetch_positions()
@@ -57,7 +86,24 @@ async def get_account_fills(
5786
ctx: Context = None,
5887
) -> dict:
5988
"""
60-
Get account fills.
89+
Analyze your executed trades to evaluate performance and execution quality.
90+
91+
Use this tool when you need to:
92+
- Review your trading history across specific markets
93+
- Calculate your average entry price for multi-fill positions
94+
- Analyze execution quality compared to intended prices
95+
- Track realized PnL from completed trades
96+
- Verify order execution details for reconciliation
97+
98+
Detailed fill information is essential for performance analysis and
99+
understanding how your orders were actually executed.
100+
101+
Example use cases:
102+
- Calculating volume-weighted average price (VWAP) of your entries
103+
- Analyzing execution slippage from your intended prices
104+
- Reviewing trade history for tax or accounting purposes
105+
- Tracking commission costs across different markets
106+
- Identifying which of your strategies produced the best execution
61107
"""
62108
client = await get_authenticated_paradex_client()
63109
params = {"market": market_id, "start_at": start_unix_ms, "end_at": end_unix_ms}
@@ -82,10 +128,24 @@ async def get_account_funding_payments(
82128
ctx: Context = None,
83129
) -> dict:
84130
"""
85-
Get account funding payments.
86-
87-
Returns:
88-
Dict[str, Any]: Account funding payments.
131+
Track your funding payment history to understand its impact on P&L.
132+
133+
Use this tool when you need to:
134+
- Calculate total funding costs or gains for a position
135+
- Analyze how funding has affected your overall performance
136+
- Plan position timing around funding payment schedules
137+
- Compare funding costs across different markets
138+
- Account for funding in your trading strategy profitability
139+
140+
Funding payments can significantly impact perpetual futures trading P&L,
141+
especially for longer-term positions or in markets with volatile funding rates.
142+
143+
Example use cases:
144+
- Calculating the total funding component of your P&L
145+
- Comparing funding costs against trading profits
146+
- Planning position entries/exits around funding payment times
147+
- Identifying markets where funding has been consistently favorable
148+
- Reconciling funding payments for accounting purposes
89149
"""
90150
client = await get_authenticated_paradex_client()
91151
params = {"market": market_id, "start_at": start_unix_ms, "end_at": end_unix_ms}

src/mcp_paradex/tools/market.py

Lines changed: 127 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,22 @@ async def get_filters_model(
2828
tool_name: Annotated[str, Field(description="The name of the tool to get the filters for.")],
2929
) -> dict:
3030
"""
31-
Get the filters for a tool.
31+
Get detailed schema information to build precise data filters.
32+
33+
Use this tool when you need to:
34+
- Understand exactly what fields are available for filtering
35+
- Learn the data types and formats for specific fields
36+
- Build complex JMESPath queries with correct syntax
37+
- Create sophisticated filtering and sorting expressions
38+
39+
Knowing the exact schema helps you construct precise filters that
40+
return exactly the data you need, avoiding trial and error.
41+
42+
Example use cases:
43+
- Learning what fields exist in market data responses
44+
- Finding the correct property names for filtering
45+
- Understanding data types for numerical comparisons
46+
- Building complex multi-criteria filters for large datasets
3247
"""
3348
tool_descriptions = {
3449
"paradex_markets": models.MarketDetails.model_json_schema(),
@@ -76,13 +91,24 @@ async def get_markets(
7691
ctx: Context = None,
7792
) -> dict:
7893
"""
79-
Get detailed information about specific markets.
94+
Find markets that match your trading criteria or get detailed market specifications.
95+
96+
Use this tool when you need to:
97+
- Understand exact tick sizes and minimum order sizes before placing trades
98+
- Find all markets for a specific asset (e.g., all BTC-based markets)
99+
- Compare contract specifications across different markets
100+
- Identify markets with specific characteristics for your trading strategy
80101
81102
Retrieves comprehensive details about specified markets, including
82103
base and quote assets, tick size, minimum order size, and other
83104
trading parameters. If "ALL" is specified or no market IDs are provided,
84105
returns details for all available markets.
85106
107+
Example use cases:
108+
- Finding the minimum order size for a new trade
109+
- Identifying markets with the smallest tick size for precise entries
110+
- Checking which assets are available for trading
111+
86112
`asset_kind` is the type of asset in the market. It can be `PERP` or `PERP_OPTION`.
87113
88114
You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results.
@@ -162,12 +188,24 @@ async def get_market_summaries(
162188
ctx: Context = None,
163189
) -> dict:
164190
"""
165-
Get a summary of market statistics and current state for specific markets.
191+
Identify the most active or volatile markets and get current market conditions.
192+
193+
Use this tool when you need to:
194+
- Find the most active markets by volume for liquidity analysis
195+
- Discover markets with significant price movements for momentum strategies
196+
- Compare current prices across multiple assets
197+
- Identify markets with unusual behavior for potential opportunities
166198
167199
Retrieves current market summary information including price, volume,
168200
24h change, and other key market metrics. If "ALL" is specified or no market IDs
169201
are provided, returns summaries for all available markets.
170202
203+
Example use cases:
204+
- Finding high-volatility markets for short-term trading
205+
- Identifying top gainers and losers for the day
206+
- Comparing volume across different markets to find liquidity
207+
- Getting the current price and 24-hour range for price analysis
208+
171209
You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results.
172210
Use the `paradex_filters_model` tool to get the filters for a tool.
173211
Examples:
@@ -225,11 +263,22 @@ async def get_funding_data(
225263
ctx: Context = None,
226264
) -> dict[str, Any]:
227265
"""
228-
Get historical funding rate data for a perpetual market.
229-
230-
Retrieves funding rate history for a specified time period, which is
231-
essential for understanding the cost of holding perpetual positions.
232-
266+
Analyze funding rates for potential funding arbitrage or to understand holding costs.
267+
268+
Use this tool when you need to:
269+
- Calculate expected funding payments for a position
270+
- Find markets with extreme funding rates for potential arbitrage
271+
- Understand historical funding patterns for a market
272+
- Evaluate the cost of holding a position over time
273+
274+
This data is critical for perpetual futures traders to assess the carrying cost
275+
of positions and identify potential funding arbitrage opportunities.
276+
277+
Example use cases:
278+
- Finding markets with negative funding for "paid to hold" opportunities
279+
- Calculating the funding component of a trade's P&L
280+
- Comparing funding rates across different assets for relative value trades
281+
- Analyzing funding rate volatility to predict potential rate changes
233282
"""
234283
try:
235284
# Get funding data from Paradex
@@ -272,11 +321,22 @@ async def get_orderbook(
272321
ctx: Context = None,
273322
) -> dict[str, Any]:
274323
"""
275-
Get the current orderbook for a market.
276-
277-
Retrieves the current state of the orderbook for a specified market,
278-
showing bid and ask orders up to the requested depth.
279-
324+
Analyze market depth and liquidity to optimize order entry and execution.
325+
326+
Use this tool when you need to:
327+
- Assess true liquidity before placing large orders
328+
- Identify potential support/resistance levels from order clusters
329+
- Determine optimal limit order prices for higher fill probability
330+
- Detect order imbalances that might signal price direction
331+
332+
Understanding the orderbook is essential for effective trade execution,
333+
especially for larger orders or in less liquid markets.
334+
335+
Example use cases:
336+
- Finding the optimal limit price to ensure your order gets filled
337+
- Estimating potential slippage for market orders of different sizes
338+
- Identifying large resting orders that might act as support/resistance
339+
- Detecting order book imbalances that could predict short-term price moves
280340
"""
281341
try:
282342
# Get orderbook from Paradex
@@ -316,11 +376,24 @@ async def get_klines(
316376
ctx: Context = None,
317377
) -> list[OHLCV]:
318378
"""
319-
Get candlestick (kline) data for a market.
320-
321-
Retrieves historical price candlestick data for a specified market and time period.
322-
Each candlestick contains open, high, low, close prices and volume information.
323-
379+
Analyze historical price patterns for technical analysis and trading decisions.
380+
381+
Use this tool when you need to:
382+
- Perform technical analysis on historical price data
383+
- Identify support and resistance levels from price history
384+
- Calculate indicators like moving averages, RSI, or MACD
385+
- Backtest trading strategies on historical data
386+
- Visualize price action over specific timeframes
387+
388+
Candlestick data is fundamental for most technical analysis and trading decisions,
389+
providing structured price and volume information over time.
390+
391+
Example use cases:
392+
- Identifying chart patterns for potential entries or exits
393+
- Calculating technical indicators for trading signals
394+
- Determining volatility by analyzing price ranges
395+
- Finding significant price levels from historical support/resistance
396+
- Measuring volume patterns to confirm price movements
324397
"""
325398
try:
326399
# Get klines from Paradex
@@ -366,10 +439,24 @@ async def get_trades(
366439
ctx: Context = None,
367440
) -> dict:
368441
"""
369-
Get recent trades for a market.
370-
371-
Retrieves historical trade data for a specified market and time period.
372-
Each trade includes price, size, side (buy/sell), and timestamp information.
442+
Analyze actual market transactions to understand market sentiment and liquidity.
443+
444+
Use this tool when you need to:
445+
- Detect large trades that might signal institutional activity
446+
- Calculate average trade size during specific periods
447+
- Identify buy/sell pressure imbalances
448+
- Monitor execution prices vs. order book prices
449+
- Understand market momentum through trade flow
450+
451+
Trade data provides insights into actual market activity versus just orders,
452+
helping you understand how other participants are behaving.
453+
454+
Example use cases:
455+
- Detecting large "whale" transactions that might influence price
456+
- Analyzing trade sizes to gauge market participation
457+
- Identifying periods of aggressive buying or selling
458+
- Understanding trade frequency as an indicator of market interest
459+
- Comparing executed prices to orderbook mid-price for market impact analysis
373460
"""
374461
try:
375462
# Get trades from Paradex
@@ -397,11 +484,24 @@ async def get_bbo(
397484
ctx: Context = None,
398485
) -> dict:
399486
"""
400-
Get the Best Bid and Offer (BBO) for a market.
401-
402-
Retrieves the current best bid and best offer (ask) prices and sizes
403-
for a specified market. This represents the tightest spread currently
404-
available.
487+
Get the current best available prices for immediate execution decisions.
488+
489+
Use this tool when you need to:
490+
- Make quick trading decisions without full orderbook depth
491+
- Calculate current spread costs before placing orders
492+
- Monitor real-time price changes efficiently
493+
- Get a snapshot of current market conditions
494+
- Determine fair mid-price for calculations
495+
496+
The BBO provides the most essential price information with minimal data,
497+
perfect for quick decisions or when full orderbook depth isn't needed.
498+
499+
Example use cases:
500+
- Calculating current trading spreads before placing orders
501+
- Monitoring real-time price movements efficiently
502+
- Determining execution prices for immediate market orders
503+
- Calculating mid-price for order placement strategies
504+
- Setting appropriate limit order prices to improve fill chances
405505
"""
406506
try:
407507
# Get BBO from Paradex

0 commit comments

Comments
 (0)