Skip to main content
Glama
appwrite

Appwrite MCP Server

Official
by appwrite

tables_db_delete_rows

Delete multiple rows from an Appwrite database table using queries. Remove all rows if no queries are specified, with support for bulk operations and transaction staging.

Instructions

Bulk delete rows using queries, if no queries are passed then all rows are deleted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesDatabase ID.
table_idYesTable ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
queriesNoArray of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
transaction_idNoTransaction ID for staging the operation.

Implementation Reference

  • Registers the TablesDB service with name 'tables_db'. This service dynamically generates MCP tools for each public method on TablesDB(client), prefixed with 'tables_db_', including 'tables_db_delete_rows'.
    tools_manager.register_service(Service(TablesDB(client), "tables_db"))
  • Dynamically sets the tool name to '{service_name}_{method_name}' (e.g., 'tables_db_delete_rows' for TablesDB.delete_rows method). No overrides defined, so uses default prefixing.
    tool_name = self._method_name_overrides.get(name, f"{self.service_name}_{name}")
  • Generates the tool's input JSON schema dynamically from the method's type hints, parameters, docstring, and signature. Output is plain text result.
    tool_definition = Tool(
        name=tool_name,
        description=f"{docstring.short_description or "No description available"}",
        inputSchema={
            "type": "object",
            "properties": properties,
            "required": required
        }
    )
  • The MCP server tool handler that resolves the tool by name, calls the bound method from TablesDB (delete_rows), handles Appwrite exceptions, and formats result as text content.
    @server.call_tool()
    async def handle_call_tool(
        name: str, arguments: dict | None
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        
        try:
            tool_info = tools_manager.get_tool(name)
            if not tool_info:
                raise McpError(f"Tool {name} not found")
            
            bound_method = tool_info["function"]
            result = bound_method(**(arguments or {}))
            if hasattr(result, 'to_dict'):
                result_dict = result.to_dict()
                return [types.TextContent(type="text", text=str(result_dict))]
            return [types.TextContent(type="text", text=str(result))]
        except AppwriteException as e:
            return [types.TextContent(type="text", text=f"Appwrite Error: {str(e)}")]
        except Exception as e:
            return [types.TextContent(type="text", text=f"Error: {str(e)}")]
  • ToolManager.register_service: Adds service tools (including tables_db_delete_rows) to the central registry used by list_tools and call_tool.
    def register_service(self, service: Service):
        """Register a new service and its tools"""
        self.services.append(service)
        self.tools_registry.update(service.list_tools())
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the destructive action ('delete rows') and the bulk nature, but doesn't mention important behavioral aspects like permissions required, whether deletions are permanent/reversible, rate limits, or what happens with the transaction_id parameter. The description is minimal and lacks crucial operational context.

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 extremely concise - a single sentence that efficiently communicates the core functionality and important edge case behavior. Every word earns its place with no redundancy or unnecessary elaboration.

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 bulk operation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical contextual information like error handling, response format, authentication requirements, or the implications of the 'all rows' deletion behavior. The tool's complexity warrants more comprehensive guidance.

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 100%, so the schema already documents all four parameters thoroughly. The description adds marginal value by explaining the behavior when 'queries' parameter is omitted ('all rows are deleted'), but doesn't provide additional semantic context beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('bulk delete rows') and the mechanism ('using queries'), with the important clarification that 'if no queries are passed then all rows are deleted.' This distinguishes it from sibling tools like 'tables_db_delete_row' (singular) and 'tables_db_delete_table' (different resource).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for bulk deletion with optional query-based filtering, but doesn't explicitly state when to use this tool versus alternatives like 'tables_db_delete_row' (single row) or 'tables_db_delete_table' (entire table). It mentions the 'all rows' behavior when queries are omitted, which provides some contextual guidance.

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/appwrite/mcp-for-api'

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