Skip to main content
Glama
hydrolix

mcp-hydrolix

Official

list_tables

Retrieve and list Hydrolix tables within a specified database to explore schema and streamline data query processes for LLM-based workflows.

Instructions

List available Hydrolix tables in a database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYes
likeNo

Implementation Reference

  • The primary handler for the 'list_tables' tool. Decorated with @mcp.tool() for registration in FastMCP. Executes queries against system.tables and system.columns to fetch comprehensive table information including metadata and column details.
    @mcp.tool()
    def list_tables(database: str, like: Optional[str] = None, not_like: Optional[str] = None):
        """List available Hydrolix tables in a database, including schema, comment,
        row count, and column count."""
        logger.info(f"Listing tables in database '{database}'")
        client = create_hydrolix_client(get_request_credential())
        query = f"SELECT database, name, engine, create_table_query, dependencies_database, dependencies_table, engine_full, sorting_key, primary_key, total_rows, total_bytes, total_bytes_uncompressed, parts, active_parts, total_marks, comment FROM system.tables WHERE database = {format_query_value(database)}"
        if like:
            query += f" AND name LIKE {format_query_value(like)}"
    
        if not_like:
            query += f" AND name NOT LIKE {format_query_value(not_like)}"
    
        result = client.query(query)
    
        # Deserialize result as Table dataclass instances
        tables = result_to_table(result.column_names, result.result_rows)
    
        for table in tables:
            column_data_query = f"SELECT database, table, name, type AS column_type, default_kind, default_expression, comment FROM system.columns WHERE database = {format_query_value(database)} AND table = {format_query_value(table.name)}"
            column_data_query_result = client.query(column_data_query)
            table.columns = [
                c
                for c in result_to_column(
                    column_data_query_result.column_names,
                    column_data_query_result.result_rows,
                )
            ]
    
        logger.info(f"Found {len(tables)} tables")
        return [asdict(table) for table in tables]
  • Dataclass defining the structure for table metadata returned by list_tables, used for output schema.
    class Table:
        database: str
        name: str
        engine: str
        create_table_query: str
        dependencies_database: str
        dependencies_table: str
        engine_full: str
        sorting_key: str
        primary_key: str
        total_rows: int
        total_bytes: int
        total_bytes_uncompressed: int
        parts: int
        active_parts: int
        total_marks: int
        comment: Optional[str] = None
        columns: List[Column] = field(default_factory=list)
  • Dataclass defining the structure for column metadata nested within Table objects.
    @dataclass
    class Column:
        database: str
        table: str
        name: str
        column_type: str
        default_kind: Optional[str]
        default_expression: Optional[str]
        comment: Optional[str]
  • Helper function to convert query results into List[Table] instances.
    def result_to_table(query_columns, result) -> List[Table]:
        return [Table(**dict(zip(query_columns, row))) for row in result]
  • Helper function to convert query results into List[Column] instances.
    def result_to_column(query_columns, result) -> List[Column]:
        return [Column(**dict(zip(query_columns, row))) for row in result]
Behavior2/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. It states the action ('List') but doesn't describe what 'List' entails—such as whether it returns all tables, includes metadata, has pagination, or requires specific permissions. This leaves significant gaps for a tool that interacts with a database system.

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, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't address key aspects like return values, error conditions, or behavioral traits needed for a database listing tool, leaving the agent with insufficient information to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter details. The description mentions 'in a database', which hints at the 'database' parameter, but doesn't explain the 'like' parameter or provide any additional context about parameter usage, formats, or constraints, failing to compensate for the low coverage.

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 ('Hydrolix tables in a database'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'list_databases', which suggests a similar listing operation but for databases rather than tables.

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 'list_databases' or 'run_select_query'. It lacks context about prerequisites (e.g., whether a database must exist) or exclusions, leaving the agent to infer usage from the tool name alone.

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/hydrolix/mcp-hydrolix'

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