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}")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool tests a connection and returns diagnostics, but doesn't elaborate on what 'diagnostics' includes (e.g., success/failure status, error details, performance metrics), whether it's a read-only operation, if it has side effects (e.g., logging or caching), or any rate limits. This leaves significant gaps in understanding the tool's behavior.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core action ('Test Pinot connection') and outcome ('return diagnostics'). There's no wasted wording, and it's appropriately sized for a simple, parameterless tool, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's low complexity (0 parameters, no annotations, no output schema), the description is minimally adequate. It states what the tool does, but lacks details on diagnostics content or behavioral traits. For a connection-testing tool, more context on output format or error handling would be helpful, though the simplicity keeps it from being severely incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so there's no need for parameter details in the description. The description doesn't add parameter semantics, but that's appropriate here. A baseline of 4 is applied since no parameters exist, and the description doesn't mislead about inputs.

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 with a specific verb ('Test') and resource ('Pinot connection'), and indicates it returns diagnostics. However, it doesn't explicitly differentiate this from sibling tools like 'read-query' or 'table-details' that might also involve connection testing indirectly, 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether a connection must be established first), typical use cases (e.g., troubleshooting or setup verification), or how it differs from other tools that might test connectivity as a side effect. This lack of context leaves the agent with minimal usage direction.

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

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

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