segment-metadata-details
Retrieve detailed metadata for specific segments of a table in the StarTree MCP Server for Apache Pinot to aid in data analysis and optimization.
Instructions
Get metadata for segments of a table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes |
Implementation Reference
- mcp_pinot/server.py:114-121 (handler)MCP tool handler function for 'segment-metadata-details'. It takes a tableName, calls the PinotClient method, serializes the result to JSON, and handles errors.def segment_metadata_details(tableName: str) -> str: """Get metadata for segments of a table""" try: results = pinot_client.get_segment_metadata_detail(tableName=tableName) return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}"
- mcp_pinot/pinot_client.py:329-338 (helper)Core implementation in PinotClient that performs HTTP GET request to the Pinot controller API endpoint /segments/{tableName}/metadata to fetch segment metadata details.def get_segment_metadata_detail( self, tableName: str, params: dict[str, Any] | None = None, ) -> dict[str, Any]: endpoint = PinotEndpoints.SEGMENT_METADATA.format(tableName) url = f"{self.config.controller_url}/{endpoint}" logger.debug(f"Fetching segment metadata for {tableName} from: {url}") response = self.http_request(url) return response.json()
- mcp_pinot/pinot_client.py:40-40 (helper)Endpoint constant defining the Pinot API path for segment metadata used by the client method.SEGMENT_METADATA = "segments/{}/metadata"
- mcp_pinot/server.py:114-121 (registration)The @mcp.tool decorator registers this function as the MCP tool named 'segment-metadata-details' (converted from snake_case). Note: handler and registration coincide.def segment_metadata_details(tableName: str) -> str: """Get metadata for segments of a table""" try: results = pinot_client.get_segment_metadata_detail(tableName=tableName) return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}"