Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

list_tables

Retrieve all table names from the Baidu Vector Database to view available data collections for vector search operations.

Instructions

List all tables in the current database.

Returns:
    str: A string containing the names of all tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'list_tables', decorated with @mcp.tool(). It retrieves the list of tables from the MochowConnector and formats them into a string response.
    @mcp.tool()
    async def list_tables(ctx: Context) -> str:
        """
        List all tables in the current database.
    
        Returns:
            str: A string containing the names of all tables.
        """
        connector = ctx.request_context.lifespan_context.connector
        tables = await connector.list_tables()
        return f"Tables in database:\n{', '.join(tables)}"
  • Helper method in MochowConnector class that lists all tables in the current database using the Mochow database client and returns a list of table names.
    async def list_tables(self) -> list[str]:
        """
        List all tables in the current database.
    
        Returns:
            list[str]: A list of table names.
        """
        if self.database is None:
            raise ValueError("Switch to the database before list tables")
        try:
            tables = self.database.list_table()
            return [table.table_name for table in tables]
        except Exception as e:
            raise ValueError(f"Failed to list tables: {str(e)}")
  • The @mcp.tool() decorator registers the list_tables function as an MCP tool.
    @mcp.tool()
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 all tables') and return type ('A string containing the names of all tables'), but doesn't disclose important behavioral traits like whether this requires specific permissions, how tables are ordered, if hidden/system tables are included, what format the string uses (e.g., comma-separated, newline-separated), or if there are any rate limits. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 perfectly concise and well-structured: one sentence states the action, and a separate 'Returns:' section clarifies the output format. Every sentence earns its place by providing essential information without redundancy. The two-sentence structure is front-loaded with the primary purpose, making it easy to scan and understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no annotations, no output schema), the description is adequate but could be more complete. It covers the basic action and return type, but lacks context about behavioral aspects (e.g., permissions, ordering, format details) and usage guidelines relative to siblings. For a zero-parameter tool, it meets minimum viability but doesn't fully leverage the opportunity to provide richer guidance.

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

Parameters4/5

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

The tool has zero parameters, and schema description coverage is 100% (though empty). The description appropriately doesn't waste space discussing nonexistent parameters. Since there are no parameters to document, the description focuses correctly on the tool's action and return value, meeting the baseline expectation for parameterless tools.

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 ('all tables in the current database'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'list_databases' or 'describe_table', but the specificity of 'tables' vs 'databases' provides implicit distinction. The description avoids tautology by not just restating the tool name.

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' (for table details) or 'list_databases' (for listing databases). It doesn't mention prerequisites such as needing a current database selected via 'use_database', nor does it indicate when this tool would be preferred over other listing or querying tools. The usage context is implied but not explicitly stated.

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/baidu/mochow-mcp-server-python'

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