Skip to main content
Glama
baidu

Baidu Vector Database MCP Server

Official
by baidu

delete_table_rows

Remove specific rows from a Baidu Vector Database table using filter expressions to delete targeted data based on defined criteria.

Instructions

Delete rows with a filter expression in the Mochow instance.

Args:
    table_name (str): Name of the table.
    filter_expr (str): Filter expression to select data to delete.

Returns:
    str: A message indicating the success of data deletion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes
filter_exprYes

Implementation Reference

  • MCP tool handler for 'delete_table_rows' that deletes rows from a specified table using a filter expression by calling the connector's delete_rows method.
    @mcp.tool()
    async def delete_table_rows(table_name: str, filter_expr: str, ctx: Context = None) -> str:
        """
        Delete rows with a filter expression in the Mochow instance.
    
        Args:
            table_name (str): Name of the table.
            filter_expr (str): Filter expression to select data to delete.
    
        Returns:
            str: A message indicating the success of data deletion.
        """
        connector = ctx.request_context.lifespan_context.connector
        await connector.delete_rows(table_name, filter_expr)
        return f"Delete rows with filter expression '{filter_expr}' successfully."
  • Helper method in MochowConnector class that executes the actual row deletion using the Mochow database API.
    async def delete_rows(self, table_name: str, filter_expr: str) -> bool:
        """
        Delete rows in a given table using a filter expression.
    
        Args:
            table_name (str): Name of the table.
            filter_expr (str): Filter expression to select data to delete.
    
        Returns:
            bool: True if the rows is deleted successfully, False otherwise.
        """
        if self.database is None:
            raise ValueError("Switch to the database before delete rows with filter expression.")
    
        try:
            self.database.table(table_name).delete(filter=filter_expr)
            return True
        except Exception as e:
            raise ValueError(f"Failed to delete data with filter expression: {filter_expr}")
  • Registration of the 'delete_table_rows' tool using the @mcp.tool() decorator.
    @mcp.tool()
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 deletes rows, implying a destructive mutation, but doesn't cover critical aspects like permissions required, whether deletions are permanent or reversible, rate limits, or error handling. The return message is mentioned but not elaborated, leaving gaps in understanding the tool's behavior and safety profile.

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 well-structured and concise, with zero wasted sentences. It starts with a clear purpose statement, followed by organized sections for Args and Returns, making it easy to scan and understand. Every sentence adds value, and the formatting enhances readability without unnecessary verbosity.

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?

Given the tool's complexity (destructive deletion with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It covers the basic purpose and parameters but misses critical context like behavioral traits (e.g., permanence of deletions), usage guidelines, and detailed return values. For a mutation tool with no structured safety hints, this leaves significant gaps for an AI agent.

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 schema provides no parameter details. The description compensates by listing both parameters ('table_name' and 'filter_expr') with brief explanations in the Args section, adding basic semantics beyond the schema. However, it doesn't explain the format of 'filter_expr' (e.g., SQL-like syntax) or provide examples, which limits its helpfulness for correct invocation.

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 tool's purpose: 'Delete rows with a filter expression in the Mochow instance.' This specifies the verb ('Delete'), resource ('rows'), and scope ('in the Mochow instance'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'drop_vector_index' or 'select_table_rows', which prevents a perfect score.

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 mentions a filter expression but doesn't explain when deletion is appropriate compared to other operations like 'select_table_rows' for viewing data or 'drop_vector_index' for removing indexes. There's no mention of prerequisites, risks, or typical use cases, leaving the agent with minimal context for decision-making.

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