Skip to main content
Glama
jason-ung

starrocks-mcp

by jason-ung

list_tables

Retrieve table names from a StarRocks database to explore available data structures for querying and analysis.

Instructions

List tables in a database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional, defaults to 'ads')

Implementation Reference

  • The handler logic in `table_tools.py` which calls the `list_tables` method on the StarRocks client.
    elif name == "list_tables":
        database = arguments.get("database")
        tables = client.list_tables(database)
        db_name = database or config.database
        return [
            TextContent(
                type="text",
                text=f"Found {len(tables)} tables in database '{db_name}':\n\n{format_json(tables)}",
            )
        ]
  • The core implementation of `list_tables` that executes the SQL query against StarRocks.
    def list_tables(self, database: Optional[str] = None) -> List[str]:
        """List tables in a database."""
        db = database or self.config.database
        validated_db = validate_identifier(db, "database")
        results = self.execute_query(f"SHOW TABLES FROM `{validated_db}`")
        # StarRocks returns column name like "Tables_in_{database}"
        key = f"Tables_in_{validated_db}"
        return [row.get(key, row.get("TABLE_NAME", "")) for row in results]
  • The registration and schema definition for the `list_tables` tool.
    Tool(
        name="list_tables",
        description="List tables in a database",
        inputSchema={
            "type": "object",
            "properties": {
                "database": {
                    "type": "string",
                    "description": "Database name (optional, defaults to 'ads')",
                }
            },
        },
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'List' implies read-only behavior, the description does not confirm safety, disclose return format (e.g., array of table names vs objects), mention pagination limits, or note the default 'ads' database behavior.

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 extremely terse at only 5 words, but it efficiently conveys the core operation without redundancy. However, it is so minimal that it fails to front-load any distinguishing characteristics or behavioral constraints that would help tool selection.

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?

For a tool with no output schema and no annotations, the description should disclose what the user receives (e.g., 'returns table names') and highlight the default database behavior. As written, it leaves significant gaps in the agent's understanding of the tool's contract.

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, establishing a baseline of 3. The tool description adds no semantic context about the 'database' parameter (e.g., not mentioning that it defaults to 'ads'), but no additional documentation is required given the complete schema.

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), resource (tables), and scope (in a database). However, it does not explicitly differentiate from sibling tools like 'describe_table' or 'list_databases', which would help the agent choose between listing metadata versus detailed schema information.

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 'describe_table' (which gets details for one table) or 'list_databases' (which scopes higher). 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/jason-ung/starrocks-mcp'

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