table-details
Retrieve table size metrics to monitor and optimize data storage in StarTree MCP Server for Apache Pinot by specifying the table name.
Instructions
Get table size details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes | Table name |
Implementation Reference
- mcp_pinot/server.py:80-88 (handler)MCP tool handler function 'table_details' that executes the tool logic by calling PinotClient.get_table_detail and returning JSON.
@mcp.tool def table_details(tableName: str) -> str: """Get table size details""" try: results = pinot_client.get_table_detail(tableName=tableName) return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}" - mcp_pinot/pinot_client.py:318-328 (helper)Helper method in PinotClient that implements the core logic for fetching table size/details via HTTP GET to the Pinot controller's /tables/{tableName}/size endpoint.
def get_table_detail( self, tableName: str, params: dict[str, Any] | None = None, ) -> dict[str, Any]: endpoint = PinotEndpoints.TABLE_SIZE.format(tableName) url = f"{self.config.controller_url}/{endpoint}" logger.debug(f"Fetching table details for {tableName} from: {url}") response = self.http_request(url) return response.json() - mcp_pinot/server.py:80-81 (registration)Registration of the 'table_details' tool using the @mcp.tool decorator.
@mcp.tool def table_details(tableName: str) -> str: - mcp_pinot/pinot_client.py:34-39 (helper)Definition of API endpoints, including TABLE_SIZE used for table-details.
class PinotEndpoints: QUERY_SQL = "query/sql" TABLES = "tables" SCHEMAS = "schemas" TABLE_SIZE = "tables/{}/size" SEGMENTS = "segments/{}"