Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

describe_table

Retrieve detailed information about a specific table in the Baidu Cloud Vector Database by specifying its name, enabling efficient data management and analysis within the MCP server environment.

Instructions

Describe table details in the Mochow instance. Args: table_name (str): Name of the table to describe. Returns: str: A string containing the details of the table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Implementation Reference

  • The handler function for the 'describe_table' MCP tool. It retrieves table details via the connector and formats them as a string response.
    @mcp.tool() async def describe_table(table_name: str, ctx: Context = None) -> str: """ Describe table details in the Mochow instance. Args: table_name (str): Name of the table to describe. Returns: str: A string containing the details of the table. """ connector = ctx.request_context.lifespan_context.connector details = await connector.describe_table_info(table_name) return f"Table details named '{table_name}' in Mochow instance:\n{str(details)}"
  • Supporting method in MochowConnector class that calls the underlying database.describe_table() and returns the info as dict. Called by the tool handler.
    async def describe_table_info(self, table_name: str) -> dict: """ Get detailed information about a table. Args: table_name (str): Name of the table. Returns: dict: A dictionary containing table details. """ if self.database is None: raise ValueError("Switch to the database before describe table") try: return self.database.describe_table(table_name).to_dict() except Exception as e: raise ValueError(f"Failed to get table detail info: {str(e)}")
  • The @mcp.tool() decorator registers the describe_table 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