ydb_status
Check the current connection status of YDB databases to monitor availability and troubleshoot connectivity issues.
Instructions
Get the current status of the YDB connection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- ydb_mcp/server.py:660-702 (handler)The handler function that executes the ydb_status tool logic. It checks the YDB driver status, performs discovery, and returns formatted JSON status including connection state, endpoint, database, auth mode, and any errors.async def get_connection_status(self) -> List[TextContent]: """Get the current status of the YDB connection. Returns: List of TextContent objects """ connection_status = "disconnected" error_message = None try: # Force create driver to ensure up-to-date status if self.driver is None: logger.info("Creating new driver for connection status check") await self.create_driver() if self.driver: try: discovery = self.driver.discovery_debug_details() if discovery.startswith("Resolved endpoints"): connection_status = "connected" else: error_message = f"Discovery error: {discovery}" except Exception as conn_error: error_message = f"Error checking connection via discovery: {conn_error}" else: error_message = "No driver available for connection status check" except Exception as e: error_message = str(e) status_info = { "status": "running", "ydb_endpoint": self.endpoint, "ydb_database": self.database, "auth_mode": self.auth_mode, "ydb_connection": connection_status, "error": error_message, } # Format the result as a TextContent object safe_status = self._stringify_dict_keys(status_info) formatted_result = json.dumps(safe_status, indent=2, cls=CustomJSONEncoder) logger.info(f"Connection status: {formatted_result}") return [TextContent(type="text", text=formatted_result)]
- ydb_mcp/server.py:612-617 (registration)Tool specification in register_tools() method where ydb_status is defined with name, description, handler reference, and empty parameter schema. This spec is used to register the tool with FastMCP.add_tool() and ToolManager.register_tool().{ "name": "ydb_status", "description": "Get the current status of the YDB connection", "handler": self.get_connection_status, # Use real handler "parameters": {"type": "object", "properties": {}, "required": []}, },
- ydb_mcp/server.py:616-616 (schema)Input schema definition for ydb_status tool: no required parameters, empty properties."parameters": {"type": "object", "properties": {}, "required": []},
- ydb_mcp/server.py:1064-1065 (helper)Dispatcher logic in the overridden call_tool() method that directly calls the get_connection_status handler for ydb_status tool.elif tool_name == "ydb_status": result = await self.get_connection_status()