Skip to main content
Glama
alaturqua

MCP Trino Server

by alaturqua

show_files

Retrieve the list of data files for a specified Iceberg table within a given catalog and schema.

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 decorated with @mcp.tool for 'show_files' — defines the tool interface (catalog, schema_name, table params) 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)
  • src/server.py:404-404 (registration)
    Tool registration via @mcp.tool decorator with description 'Show Iceberg table data files'.
    @mcp.tool(description="Show Iceberg table data files")
  • Client-side implementation of show_files — constructs a Trino SQL query against the $files metadata table (e.g., catalog.schema.table$files) and executes it, returning 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?

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, required permissions, or performance implications. It carries the full burden but only states what the tool does, not how it behaves.

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?

The description is a single sentence, concise and front-loaded. It efficiently conveys the core purpose without excess, though it could expand slightly without losing conciseness.

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 sibling tools and the existence of an output schema, the description is too minimal. It lacks context on what 'data files' includes, how the output relates to other tools, and any caveats. More details would aid completeness.

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 coverage is 100%, so the description does not need to add parameter details. The schema defines catalog, schema_name, and table adequately. The description adds no extra meaning, meeting the baseline.

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 'Show' and the resource 'Iceberg table data files', distinguishing it from sibling tools like show_manifests or show_snapshots. However, 'data files' could be more specific, but overall purpose is clear.

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 like show_manifests or show_snapshots. No context about prerequisites or typical use cases is given.

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