Skip to main content
Glama
startreedata

StarTree MCP Server for Apache Pinot

Official
by startreedata

test-connection

Verify Apache Pinot connection status and retrieve diagnostics to ensure proper integration and functionality with the StarTree MCP Server.

Instructions

Test Pinot connection and return diagnostics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'test-connection'. Decorated with @mcp.tool, calls pinot_client.test_connection() and serializes result to JSON.
    @mcp.tool def test_connection() -> str: """Test Pinot connection and return diagnostics""" try: results = pinot_client.test_connection() return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}"
  • Core implementation of connection testing in PinotClient class. Performs connection validation, sample query execution, table listing, and returns comprehensive diagnostics.
    def test_connection(self) -> dict[str, Any]: """Test the connection and return diagnostic information""" result = { "connection_test": False, "query_test": False, "tables_test": False, "error": None, "config": { "broker_host": self.config.broker_host, "broker_port": self.config.broker_port, "broker_scheme": self.config.broker_scheme, "controller_url": self.config.controller_url, "database": self.config.database, "use_msqe": self.config.use_msqe, "has_token": bool(self.config.token), "has_username": bool(self.config.username), "timeout_config": { "connection": self.config.connection_timeout, "request": self.config.request_timeout, "query": self.config.query_timeout, }, }, } try: # Test basic connection conn = self.get_connection() result["connection_test"] = True # Test simple query curs = conn.cursor() curs.execute("SELECT 1 as test_column") test_result = curs.fetchall() result["query_test"] = True result["query_result"] = test_result # Test tables listing tables = self.get_tables() result["tables_test"] = True result["tables_count"] = len(tables) result["sample_tables"] = tables[:5] if tables else [] except Exception as e: result["error"] = str(e) logger.error(f"Connection test failed: {e}") return result
  • Utility function to test database connection by executing a simple SELECT 1 query. Used internally by PinotClient.
    def test_connection_query(connection) -> None: """Test connection with a simple query""" test_cursor = connection.cursor() test_cursor.execute("SELECT 1") test_result = test_cursor.fetchall() logger.debug(f"Connection test successful: {test_result}")

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/startreedata/mcp-pinot'

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