Skip to main content
Glama
startreedata

StarTree MCP Server for Apache Pinot

Official
by startreedata

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
NameRequiredDescriptionDefault
tableNameYesTable name

Implementation Reference

  • 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)}"
  • 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()
  • Endpoint constant used by get_segments to format the URL path for listing segments.
    SEGMENTS = "segments/{}" SEGMENT_METADATA = "segments/{}/metadata"

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