Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

drop_vector_index

Remove a vector index from a table in Baidu Vector Database to manage storage or modify search structures.

Instructions

Drop the vector index in the Mochow instance.

Args:
    table_name (str): Name of the table.
    index_name (str): Name of the vector index to drop.

Returns:
    str: A message indicating the success of index drop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes
index_nameYes

Implementation Reference

  • Core handler logic in MochowConnector that checks if the vector index exists and drops it using the database API.
    async def drop_vector_index(self, table_name: str, index_name: str) -> bool:
        """
        Drop a vector index in a given table.
    
        Args:
            table_name (str): Name of the table.
            index_name (str): Name of the vector index.
    
        Returns:
            bool: True if the index is dropped successfully or does not exist, False otherwise.
        """
        if self.database is None:
            raise ValueError("Switch to the database before drop vector index")
    
        # check vector index
        index_existed = True
        try:
            self.database.table(table_name).describe_index(index_name)
        except ServerError as e:
            if e.code == ServerErrCode.INDEX_NOT_EXIST:
                index_existed = False
            else:
                raise ValueError(f"Failed to get index detail: {str(e)}")
    
        # index already existed with same name
        if not index_existed:
            return True
        try:
            self.database.table(table_name).drop_index(index_name)
            return True
        except Exception as e:
            raise ValueError(f"Failed to drop vector index: {str(e)}")
  • Registers the 'drop_vector_index' tool with MCP using @mcp.tool() decorator. This is the entry point function called by MCP, which delegates to the connector's handler.
    @mcp.tool()
    async def drop_vector_index(table_name: str, index_name: str, ctx: Context = None) -> str:
        """
        Drop the vector index in the Mochow instance.
    
        Args:
            table_name (str): Name of the table.
            index_name (str): Name of the vector index to drop.
    
        Returns:
            str: A message indicating the success of index drop.
        """
        connector = ctx.request_context.lifespan_context.connector
        await connector.drop_vector_index(table_name, index_name)
        return f"Drop the vector index '{index_name}' successfully."
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a destructive operation ('Drop'), implying mutation, but doesn't specify permissions required, whether the action is reversible, rate limits, or error conditions. The return message format is mentioned but not detailed. For a destructive tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by parameter and return sections. Every sentence adds value: the first states the action, and the subsequent lines document inputs/outputs. It could be slightly more front-loaded by integrating parameter context into the main description.

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

Completeness2/5

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

For a destructive tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks critical context: error handling, side effects, dependencies (e.g., whether the database must be in use), and detailed return values. The agent would struggle to use this safely without additional information.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It lists both parameters with brief explanations ('Name of the table', 'Name of the vector index to drop'), adding basic semantics beyond the schema's titles. However, it doesn't provide format examples, constraints, or relationships between parameters, leaving room for ambiguity.

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 action ('Drop') and resource ('vector index in the Mochow instance'), making the purpose immediately understandable. It distinguishes from siblings like 'create_vector_index' and 'rebuild_vector_index' by specifying deletion rather than creation or maintenance. However, it doesn't fully differentiate from all siblings (e.g., 'delete_table_rows' also removes data).

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. It doesn't mention prerequisites (e.g., whether the index must exist), consequences (e.g., impact on queries), or when to choose this over other deletion tools like 'delete_table_rows'. The agent must infer usage from context alone.

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