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)}"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get metadata for segments of a table', which implies a read-only operation, but does not specify permissions, rate limits, error handling, or what 'metadata' entails (e.g., format, scope). This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what 'metadata' includes, how segments are defined, or the return format. For a tool that likely returns structured data about table segments, this leaves significant gaps in understanding its behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one parameter 'tableName' with 0% description coverage, and the description does not add any details about this parameter (e.g., format, examples, constraints). Since there is only one parameter, the baseline is 4, but the description fails to compensate for the lack of schema documentation, so it is scored lower as it provides no semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'metadata for segments of a table', which is specific and understandable. However, it does not explicitly differentiate from sibling tools like 'segment-list' or 'table-details', which might have overlapping or related functionality, so it falls short of a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings such as 'segment-list' and 'table-details', there is no indication of context, prerequisites, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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