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"
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 the action ('List segments') but does not describe traits such as whether this is a read-only operation, if it requires specific permissions, what the output format looks like (e.g., list of segment names or objects), or any rate limits. The description is minimal and lacks essential behavioral context 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 zero wasted words. It is appropriately sized for a simple list operation and front-loaded with the core action. Every part of the sentence earns its place by directly stating the tool's function.

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 tool's simplicity (one parameter, no output schema, no annotations), the description is incomplete. It lacks information on behavioral traits (e.g., read-only nature, output format), usage context, and does not leverage the absence of annotations to provide necessary details. For a tool with no structured data beyond the input schema, the description should do more to ensure the agent can use it correctly.

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?

Schema description coverage is 100%, with the parameter 'tableName' fully documented in the schema as 'Table name'. The description does not add any meaning beyond this, such as explaining what constitutes a valid table name or providing examples. With high schema coverage, the baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

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 ('List') and resource ('segments for a table'), making the purpose understandable. It distinguishes from siblings like 'list-tables' (which lists tables) or 'segment-metadata-details' (which provides detailed metadata), but could be more specific about what 'segments' are in this context. No tautology or misleading elements are present.

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. It does not mention prerequisites (e.g., needing an existing table), exclusions, or comparisons to siblings like 'segment-metadata-details' (which might offer more detailed segment information). Usage is implied by the action but lacks explicit context.

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