Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_klines

Analyze historical price data for technical analysis and trading decisions. Calculate indicators, identify support/resistance levels, and backtest strategies using candlestick data.

Instructions

Analyze historical price patterns for technical analysis and trading decisions.

Use this tool when you need to:
- Perform technical analysis on historical price data
- Identify support and resistance levels from price history
- Calculate indicators like moving averages, RSI, or MACD
- Backtest trading strategies on historical data
- Visualize price action over specific timeframes

Candlestick data is fundamental for most technical analysis and trading decisions,
providing structured price and volume information over time.

Example use cases:
- Identifying chart patterns for potential entries or exits
- Calculating technical indicators for trading signals
- Determining volatility by analyzing price ranges
- Finding significant price levels from historical support/resistance
- Measuring volume patterns to confirm price movements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get klines for.
resolutionNoThe time resolution of the klines.
start_unix_msYesStart time in unix milliseconds.
end_unix_msYesEnd time in unix milliseconds.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'paradex_klines' tool. It fetches historical OHLCV (kline) data from the Paradex API using the provided market symbol, resolution, and time range. Parses the raw API response into a list of OHLCV Pydantic models.
    @server.tool(name="paradex_klines")
    async def get_klines(
        market_id: Annotated[str, Field(description="Market symbol to get klines for.")],
        resolution: Annotated[
            KLinesResolutionEnum, Field(default=1, description="The time resolution of the klines.")
        ],
        start_unix_ms: Annotated[int, Field(description="Start time in unix milliseconds.")],
        end_unix_ms: Annotated[int, Field(description="End time in unix milliseconds.")],
        ctx: Context = None,
    ) -> list[OHLCV]:
        """
        Analyze historical price patterns for technical analysis and trading decisions.
    
        Use this tool when you need to:
        - Perform technical analysis on historical price data
        - Identify support and resistance levels from price history
        - Calculate indicators like moving averages, RSI, or MACD
        - Backtest trading strategies on historical data
        - Visualize price action over specific timeframes
    
        Candlestick data is fundamental for most technical analysis and trading decisions,
        providing structured price and volume information over time.
    
        Example use cases:
        - Identifying chart patterns for potential entries or exits
        - Calculating technical indicators for trading signals
        - Determining volatility by analyzing price ranges
        - Finding significant price levels from historical support/resistance
        - Measuring volume patterns to confirm price movements
        """
        try:
            # Get klines from Paradex
            client = await get_paradex_client()
            response = await api_call(
                client,
                "markets/klines",
                params={
                    "symbol": market_id,
                    "resolution": str(resolution),
                    "start_at": start_unix_ms,
                    "end_at": end_unix_ms,
                },
            )
            if "error" in response:
                raise Exception(response["error"])
            results = response["results"]
            list_of_ohlcv = [
                OHLCV(
                    timestamp=result[0],
                    open=result[1],
                    high=result[2],
                    low=result[3],
                    close=result[4],
                    volume=result[5],
                )
                for result in results
            ]
            return list_of_ohlcv
        except Exception as e:
            await ctx.error(f"Error fetching klines for {market_id}: {e!s}")
            raise e
  • Input resolution type (KLinesResolutionEnum) and output schema (OHLCV model) for the paradex_klines tool.
    KLinesResolutionEnum = Literal[1, 3, 5, 15, 30, 60]
    
    
    class OHLCV(BaseModel):
        """OHLCV data for a market."""
    
        timestamp: int
        open: float
        high: float
        low: float
        close: float
        volume: float
  • Registration of the paradex_klines tool using the FastMCP server decorator.
    @server.tool(name="paradex_klines")
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. It describes behavioral aspects like analyzing historical data for technical analysis, backtesting, and visualization, which goes beyond the input schema. However, it lacks details on critical behaviors such as rate limits, authentication requirements, data freshness, or error handling. For a tool with no annotations, this is a moderate but incomplete disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose statement, followed by bulleted lists for use cases and examples. However, it includes redundant phrasing (e.g., 'Candlestick data is fundamental...' adds little value) and could be more streamlined. Some sentences don't earn their place, making it slightly verbose rather than optimally concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (historical data analysis), the description covers purpose and usage well, and an output schema exists (per context signals), so it doesn't need to explain return values. With no annotations, it could improve by adding more behavioral context, but it's largely complete for guiding an agent on when and how to use this tool effectively.

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?

Schema description coverage is 100%, so the schema already documents all parameters (market_id, resolution, start_unix_ms, end_unix_ms) with descriptions. The description doesn't add any specific parameter semantics beyond what's in the schema (e.g., it doesn't explain format details or constraints). According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

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: 'Analyze historical price patterns for technical analysis and trading decisions.' It specifies the verb ('analyze') and resource ('historical price patterns'), making it distinct from siblings like account management or order execution tools. However, it doesn't explicitly differentiate from potential similar tools (e.g., 'paradex_trades' might also provide price data), so it doesn't reach the highest score.

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 a bulleted list of specific use cases (e.g., 'Perform technical analysis on historical price data,' 'Calculate indicators like moving averages'), which gives clear context for when to use this tool. It implies usage for technical analysis rather than real-time trading or account management, aligning with sibling tools. However, it doesn't explicitly state when NOT to use it or name alternatives, preventing a score of 5.

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