get_api_key_information
Retrieve detailed API key information from the Bybit Server to monitor permissions, restrictions, and usage. Essential for managing and verifying API access securely.
Instructions
Get API key information
Returns:
Dict: API key information
Example:
get_api_key_information()
Reference:
https://bybit-exchange.github.io/docs/v5/user/apikey-info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:567-588 (handler)The primary MCP tool handler for 'get_api_key_information', decorated with @mcp.tool(). It invokes the service method, processes the response, and handles errors by checking retCode and exceptions.def get_api_key_information() -> Dict: """ Get API key information Returns: Dict: API key information Example: get_api_key_information() Reference: https://bybit-exchange.github.io/docs/v5/user/apikey-info """ try: result = bybit_service.get_api_key_information() if result.get("retCode") != 0: logger.error(f"Failed to get API key information: {result.get('retMsg')}") return {"error": result.get("retMsg")} return result except Exception as e: logger.error(f"Failed to get API key information: {e}", exc_info=True) return {"error": str(e)}
- src/service.py:480-488 (helper)Helper method in BybitService class that directly calls the underlying client library's get_api_key_information() method to fetch the API key details.def get_api_key_information(self) -> Dict: """ Get API key information Returns: Dict: API key information """ return self.client.get_api_key_information()
- src/server.py:647-647 (registration)The tool is listed in the MCP prompt template as an available tool, indicating its registration via the @mcp.tool() decorator.- get_api_key_information() - Get API key information: Retrieve API key information.