Skip to main content
Glama
alaturqua

MCP Trino Server

by alaturqua

show_stats

Retrieve statistics for a table in a given catalog and schema to analyze data distribution and query performance.

Instructions

Show statistics for a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalogYescatalog name
schema_nameYesschema name
tableYesThe name of the table

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • TrinoClient method that builds SHOW STATS FOR query and executes it against Trino.
    def show_stats(self, catalog: str, schema: str, table: str) -> str:
        """Show statistics for a table.
    
        Args:
            catalog (str): The catalog name. If None, uses configured default.
            schema (str): The schema name. If None, uses configured default.
            table (str): The name of the table.
    
        Returns:
            str: JSON-formatted string containing table statistics.
    
        Raises:
            CatalogSchemaError: If either catalog or schema is not specified and not configured.
        """
        catalog = catalog or self.config.catalog
        schema = schema or self.config.schema
        if not catalog or not schema:
            raise CatalogSchemaError
        query = f"SHOW STATS FOR {catalog}.{schema}.{table}"
        return self.execute_query(query)
  • src/server.py:202-218 (registration)
    MCP tool registration for 'show_stats' using @mcp.tool decorator, defining parameters and delegating to TrinoClient.
    @mcp.tool(description="Show statistics for a table")
    def show_stats(
        catalog: str = Field(description="catalog name "),
        schema_name: str = Field(description="schema name "),
        table: str = Field(description="The name of the table"),
    ) -> str:
        """Show statistics for a table.
    
        Args:
            catalog: catalog name
            schema_name: schema name
            table: The name of the table
    
        Returns:
            str: Table statistics in JSON format
        """
        return client.show_stats(catalog, schema_name, table)
Behavior2/5

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

No annotations provided, so the description must disclose behavior. It fails to state that the tool is read-only, what data is returned, or any side effects. The output schema exists but is not referenced in the description.

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

Conciseness4/5

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

Single sentence, no redundancy. Concise and front-loaded with the core action, though it could include more detail without sacrificing brevity.

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

Completeness3/5

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

For a simple statistical display tool with a complete schema and output schema, the description is minimally adequate. However, it lacks context about the output structure or when to use, leaving gaps for an AI agent.

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 clear descriptions for each parameter. The tool description adds no additional meaning beyond the schema, meeting baseline expectations.

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 'Show statistics for a table' clearly states the verb and resource, differentiating it from siblings like 'show_tables' or 'show_partitions'. However, it could specify what type of statistics (e.g., row count, size) for higher precision.

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?

No guidance on when to use this tool versus alternatives like 'describe_table' or 'show_table_properties'. The description lacks context about typical use cases or exclusions.

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

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/alaturqua/mcp-trino-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server