Skip to main content
Glama

get_instruments_info

Retrieve detailed exchange instrument information, including category, symbol, status, and base coin, directly from Bybit API to analyze market data and execute trades efficiently.

Instructions

Get exchange information

Args:
    category (str): Category (spot, linear, inverse, etc.)
    symbol (str): Symbol (e.g., BTCUSDT)
    status (Optional[str]): Status
    baseCoin (Optional[str]): Base coin

Returns:
    Dict: Exchange information

Example:
    get_instruments_info("spot", "BTCUSDT", "Trading", "BTC")

Reference:
    https://bybit-exchange.github.io/docs/v5/market/instrument

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseCoinNoBase coin
categoryYesCategory (spot, linear, inverse, etc.)
statusNoStatus
symbolYesSymbol (e.g., BTCUSDT)

Implementation Reference

  • The primary MCP tool handler for 'get_instruments_info'. Registered via @mcp.tool(), defines input schema using Pydantic Field descriptions, implements logic by calling BybitService helper with error handling and logging.
    @mcp.tool()
    def get_instruments_info(
        category: str = Field(description="Category (spot, linear, inverse, etc.)"),
        symbol: str = Field(description="Symbol (e.g., BTCUSDT)"),
        status: Optional[str] = Field(default=None, description="Status"),
        baseCoin: Optional[str] = Field(default=None, description="Base coin")
    ) -> Dict:
        """
        Get exchange information
    
        Args:
            category (str): Category (spot, linear, inverse, etc.)
            symbol (str): Symbol (e.g., BTCUSDT)
            status (Optional[str]): Status
            baseCoin (Optional[str]): Base coin
    
        Returns:
            Dict: Exchange information
    
        Example:
            get_instruments_info("spot", "BTCUSDT", "Trading", "BTC")
    
        Reference:
            https://bybit-exchange.github.io/docs/v5/market/instrument
        """
        try:
            result = bybit_service.get_instruments_info(category, symbol, status, baseCoin)
            if result.get("retCode") != 0:
                logger.error(f"Failed to get instruments information: {result.get('retMsg')}")
                return {"error": result.get("retMsg")}
            return result
        except Exception as e:
            logger.error(f"Failed to get instruments information: {e}", exc_info=True)
            return {"error": str(e)}
  • Supporting helper method in BybitService class that directly delegates to the underlying pybit.unified_trading.HTTP client's get_instruments_info method.
    def get_instruments_info(self, category: str, symbol: str,
                             status: Optional[str] = None, baseCoin: Optional[str] = None) -> Dict:
        """
        Get exchange information
    
        Args:
            category (str): Category (spot, linear, inverse, etc.)
            symbol (str): Symbol (e.g., BTCUSDT)
            status (Optional[str]): Status
            baseCoin (Optional[str]): Base coin
    
        Returns:
            Dict: Exchange information
        """
        return self.client.get_instruments_info(
            category=category,
            symbol=symbol,
            status=status,
            baseCoin=baseCoin
        )
Install Server

Other Tools

Related 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/dlwjdtn535/mcp-bybit-server'

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