Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

list_databases

Retrieve all database names from the Baidu Vector Database MCP Server instance to view available data collections for vector search operations.

Instructions

List all databases in the Mochow instance.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'list_databases'. It retrieves the list of databases from the MochowConnector and returns a formatted string listing them.
    async def list_databases(ctx: Context = None) -> str:
        """
        List all databases in the Mochow instance.
    
        Returns:
            str: A string containing the names of all databases.
        """
        connector = ctx.request_context.lifespan_context.connector
        databases = await connector.list_databases()
        return f"Databases in Mochow instance:\n{', '.join(databases)}"
  • Helper method in the MochowConnector class that calls the underlying MochowClient to list databases and extracts their names.
    async def list_databases(self) -> list[str]:
        """
        List all databases in the Mochow instance.
    
        Returns:
            list[str]: A list of database names.
        """
        try:
            databases = self.client.list_databases()
            return [database.database_name for database in databases]
        except Exception as e:
            raise ValueError(f"Failed to list databases: {str(e)}")
  • The @mcp.tool() decorator registers the list_databases function as an MCP tool.
    async def list_databases(ctx: Context = None) -> str:
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. It states the tool lists databases and returns a string of names, but lacks details such as whether this requires specific permissions, how the string is formatted (e.g., comma-separated, newline-separated), if there are rate limits, or if it's a read-only operation. This leaves significant gaps for an agent to understand the tool's 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 front-loaded with the core purpose in the first sentence, and the second sentence adds necessary return value information. Both sentences earn their place by providing essential details without redundancy or fluff, making it appropriately sized and well-structured.

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 low complexity (0 parameters, no output schema, no annotations), the description covers the basic purpose and return value adequately. However, it lacks completeness in usage guidelines and behavioral details, such as formatting of the return string or interaction with sibling tools, which could help an agent use it more effectively in context.

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 input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description appropriately doesn't discuss parameters, which is efficient. However, it could have mentioned that no parameters are required, but this is minor given the schema's clarity.

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 databases in the Mochow instance'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_tables' or 'use_database', which would require mentioning it's for databases specifically rather than tables or other resources.

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. For example, it doesn't mention if this should be used before 'use_database' to select a database, or how it relates to 'list_tables' for listing tables within a database. There's no explicit when/when-not or alternative tool references.

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