tables_db_increment_row_column
Increase a numeric value in a specific database table cell by a specified amount. Use this tool to update counters, track metrics, or modify numerical data in Appwrite databases.
Instructions
Increment a specific column of a row by a given value.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID. | |
| table_id | Yes | Table ID. | |
| row_id | Yes | Row ID. | |
| column | Yes | Column key. | |
| value | No | Value to increment the column by. The value must be a number. | |
| max | No | Maximum value for the column. If the current value is greater than this value, an error will be thrown. | |
| transaction_id | No | Transaction ID for staging the operation. |
Implementation Reference
- src/mcp_server_appwrite/server.py:71-71 (registration)Registers the TablesDB Appwrite service with the ToolManager using service name 'tables_db'. This enables dynamic tool generation for all public methods of TablesDB, including 'tables_db_increment_row_column' which wraps TablesDB.increment_row_column.tools_manager.register_service(Service(TablesDB(client), "tables_db"))
- src/mcp_server_appwrite/server.py:94-94 (registration)Default registration of TablesDB service if no specific services are enabled.tools_manager.register_service(Service(TablesDB(client), "tables_db"))
- Generates the tool name by prefixing the service name ('tables_db') to the method name ('increment_row_column'), producing 'tables_db_increment_row_column'.tool_name = self._method_name_overrides.get(name, f"{self.service_name}_{name}")
- Dynamically generates the JSON schema for the tool input based on the method's type hints, docstring, and signature.tool_definition = Tool( name=tool_name, description=f"{docstring.short_description or "No description available"}", inputSchema={ "type": "object", "properties": properties, "required": required }
- The generic MCP tool handler that resolves the tool by name, retrieves the bound Appwrite SDK method, invokes it with arguments, and formats the 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)}")]