segment-list
Retrieve and list all segments associated with a specific table in Apache Pinot using this tool, ensuring efficient data management and analysis.
Instructions
List segments for a table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes | Table name |
Implementation Reference
- mcp_pinot/server.py:90-97 (handler)The main handler function for the 'segment-list' MCP tool. It takes a tableName parameter, calls the pinot_client.get_segments method, and returns the JSON-formatted results or an error message.@mcp.tool def segment_list(tableName: str) -> str: """List segments for a table""" try: results = pinot_client.get_segments(tableName=tableName) return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}"
- mcp_pinot/pinot_client.py:340-349 (helper)Helper method in PinotClient class that implements the core logic: constructs the URL to the Pinot controller's segments endpoint and makes an HTTP GET request to retrieve the list of segments for the given table.def get_segments( self, tableName: str, params: dict[str, Any] | None = None, ) -> dict[str, Any]: endpoint = PinotEndpoints.SEGMENTS.format(tableName) url = f"{self.config.controller_url}/{endpoint}" logger.debug(f"Fetching segments for {tableName} from: {url}") response = self.http_request(url) return response.json()
- mcp_pinot/pinot_client.py:39-40 (helper)Endpoint constant used by get_segments to format the URL path for listing segments.SEGMENTS = "segments/{}" SEGMENT_METADATA = "segments/{}/metadata"