Skip to main content
Glama
startreedata

StarTree MCP Server for Apache Pinot

Official
by startreedata

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
NameRequiredDescriptionDefault
tableNameYes

Implementation Reference

  • 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)}"
  • 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()
  • Endpoint constant defining the Pinot API path for segment metadata used by the client method.
    SEGMENT_METADATA = "segments/{}/metadata"
  • 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)}"

Tool Definition Quality

Score is being calculated. Check back soon.

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