Skip to main content
Glama
alaturqua

MCP Trino Server

by alaturqua

show_files

View underlying data files of Iceberg tables by specifying catalog, schema, and table names to analyze storage structure and file organization.

Instructions

Show Iceberg table data files

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'show_files'. Decorated with @mcp.tool(), validates inputs using pydantic Field schemas, and delegates to client.show_files().
    @mcp.tool(description="Show Iceberg table data files")
    def show_files(
        catalog: str = Field(description="catalog name "),
        schema_name: str = Field(description="schema name "),
        table: str = Field(description="The name of the table"),
    ) -> str:
        """Show Iceberg table data files in current snapshot.
    
        The files table contains:
        - content: Type of content (0=DATA, 1=POSITION_DELETES, 2=EQUALITY_DELETES)
        - file_path: Data file location
        - file_format: Format of the data file
        - record_count: Number of records in file
        - file_size_in_bytes: File size
        - column_sizes: Column ID to size mapping
        - value_counts: Column ID to value count mapping
        - null_value_counts: Column ID to null count mapping
        - nan_value_counts: Column ID to NaN count mapping
        - lower_bounds: Column ID to lower bound mapping
        - upper_bounds: Column ID to upper bound mapping
        - key_metadata: Encryption key metadata
        - split_offsets: Recommended split locations
        - equality_ids: Field IDs for equality deletes
    
        Args:
            catalog: catalog name
            schema_name: schema name
            table: The name of the table
    
        Returns:
            str: JSON-formatted table files info
        """
        return client.show_files(catalog, schema_name, table)
  • Core implementation of show_files in TrinoClient class. Constructs SQL query to query the Iceberg $files metadata table and returns JSON-formatted results.
    def show_files(self, table: str, catalog: str, schema: str) -> str:
        """Show Iceberg table data files in current snapshot.
    
        The files table contains:
        - content: INTEGER - Type of content (0=DATA, 1=POSITION_DELETES, 2=EQUALITY_DELETES)
        - file_path: VARCHAR - Data file location
        - file_format: VARCHAR - Format of the data file
        - record_count: BIGINT - Number of records in file
        - file_size_in_bytes: BIGINT - File size
        - column_sizes: map(INTEGER, BIGINT) - Column ID to size mapping
        - value_counts: map(INTEGER, BIGINT) - Column ID to value count mapping
        - null_value_counts: map(INTEGER, BIGINT) - Column ID to null count mapping
        - nan_value_counts: map(INTEGER, BIGINT) - Column ID to NaN count mapping
        - lower_bounds: map(INTEGER, VARCHAR) - Column ID to lower bound mapping
        - upper_bounds: map(INTEGER, VARCHAR) - Column ID to upper bound mapping
        - key_metadata: VARBINARY - Encryption key metadata
        - split_offsets: array(BIGINT) - Recommended split locations
        - equality_ids: array(INTEGER) - Field IDs for equality deletes
    
        Args:
            table: The name of the table
            catalog: Optional catalog name (defaults to configured catalog)
            schema: Optional schema name (defaults to configured schema)
    
        Returns:
            str: JSON-formatted string containing table files info
        """
        catalog = catalog or self.config.catalog
        schema = schema or self.config.schema
        if not catalog or not schema:
            raise CatalogSchemaError
        table_identifier = f"{catalog}.{schema}.{table}$files"
        query = 'SELECT * FROM "{}"'
        return self.execute_query(query.format(table_identifier))
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers almost none. It doesn't indicate whether this is a read-only operation (implied by 'Show' but not confirmed), whether it accesses live data, or if there are performance considerations when listing files from large tables.

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 exactly four words with zero redundancy. It is appropriately front-loaded and every word earns its place. The brevity is efficient, though arguably underspecified given the tool's context.

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 20+ sibling tools with similar 'show_' prefixes and the complexity of Iceberg table management, the description is insufficient. While an output schema exists (excusing return value descriptions), the description fails to clarify the scope of 'data files' or how this differs from show_entries/show_manifests.

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 100% description coverage, with each parameter already documented ('catalog name', 'schema name', 'The name of the table'). The description adds no additional parameter context, but per rubric guidelines, baseline 3 is appropriate when schema coverage exceeds 80%.

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 uses a specific verb ('Show') and resource ('Iceberg table data files'), clearly distinguishing it from siblings like show_manifests or show_partitions by specifying 'data files'. However, it lacks detail about what constitutes a data file in the Iceberg context (e.g., Parquet files vs. metadata).

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 similar sibling tools like show_entries, show_manifests, or show_partitions. There are no stated prerequisites, exclusions, or alternatives.

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