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:

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