Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

list_databases

Retrieve a list of all databases available in the Mochow instance using Baidu Vector Database MCP Server, enabling efficient database management and operations for LLM applications.

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 primary MCP tool handler for 'list_databases'. It uses the MochowConnector to fetch the list of databases and returns a formatted string listing them.
    @mcp.tool() 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)}"
  • Supporting helper method in the MochowConnector class that interfaces with the pymochow client to retrieve and format the list of database 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.
    @mcp.tool()

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

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