Skip to main content
Glama
alaturqua

MCP Trino Server

by alaturqua

describe_table

Retrieve table schema and column metadata from Trino catalogs to understand database structure and data types.

Instructions

Describe a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalogYesThe catalog name
schema_nameYesThe schema name
tableYesThe name of the table

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for 'describe_table'. Decorated with @mcp.tool(), it accepts catalog, schema_name, and table parameters, and delegates to the Trino client.
    @mcp.tool(description="Describe a table")
    def describe_table(
        catalog: str = Field(description="The catalog name"),
        schema_name: str = Field(description="The schema name"),
        table: str = Field(description="The name of the table"),
    ) -> str:
        """Describe a table.
    
        Args:
            catalog (str): The catalog name
            schema_name (str): The schema name
            table (str): The name of the table
    
        Returns:
            str: Table description in JSON format
        """
        return client.describe_table(catalog, schema_name, table)
  • TrinoClient helper method that executes the actual DESCRIBE SQL query against Trino. Handles default catalog/schema resolution and returns JSON-formatted results.
    def describe_table(self, catalog: str, schema: str, table: str) -> str:
        """Describe the structure of 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 description.
    
        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"DESCRIBE {catalog}.{schema}.{table}"
        return self.execute_query(query)
  • src/server.py:71-71 (registration)
    MCP tool registration decorator that registers the describe_table function as a tool named 'describe_table' with the FastMCP server.
    @mcp.tool(description="Describe a table")
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but adds none. It does not indicate whether this is read-only (though implied by 'describe'), what gets returned (despite output schema existence), or any side effects/limitations.

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

Conciseness2/5

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

While brief (3 words), this is under-specification rather than effective conciseness. The single 'sentence' fails to earn its place by providing minimal actionable information beyond the tool name itself.

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?

Despite having an output schema (covering return values) and only 3 parameters, the description is incomplete given the rich sibling context. It fails to clarify the depth of description provided (DDL vs. simple column listing) or how it relates to the extensive catalog of metadata tools available.

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?

Input schema has 100% description coverage (catalog, schema_name, and table are all documented). The description adds no parameter semantics, but the baseline score of 3 applies when schema coverage is high and descriptions are complete.

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

Purpose2/5

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

The description 'Describe a table' is essentially a tautology that restates the tool name (describe_table). While it identifies the resource (table), it fails to specify what 'describe' entails (schema, columns, metadata?) or distinguish from siblings like show_create_table, show_stats, or show_table_properties.

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

Usage Guidelines1/5

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

No guidance provided on when to use this tool versus the 20+ sibling tools available (e.g., when to prefer this over show_create_table or show_stats). No prerequisites or conditions are mentioned.

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