tables_db_update
Modify a database's configuration in Appwrite by updating its name, status, or other properties using its unique ID.
Instructions
Update a database by its unique ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID. | |
| name | Yes | Database name. Max length: 128 chars. | |
| enabled | No | Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. |
Implementation Reference
- Generic handler for all MCP tools, including 'tables_db_update'. Retrieves the tool's bound method (TablesDB.update) from the registry and executes it with the provided arguments, returning 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)}")]
- Dynamically generates the input JSON Schema for each tool, including 'tables_db_update', based on the underlying Appwrite method's type hints, signature, and docstring.tool_definition = Tool( name=tool_name, description=f"{docstring.short_description or "No description available"}", inputSchema={ "type": "object", "properties": properties, "required": required } )
- src/mcp_server_appwrite/server.py:70-72 (registration)Explicit registration of the TablesDB service as 'tables_db' when --tables-db flag is provided, making its methods (including 'update') available as prefixed tools like 'tables_db_update'.if args.tables_db: tools_manager.register_service(Service(TablesDB(client), "tables_db")) if args.users:
- src/mcp_server_appwrite/server.py:92-95 (registration)Default registration of the 'tables_db' service if no specific services are enabled via CLI flags.if not any([args.databases, args.tables_db, args.users, args.teams, args.storage, args.functions, args.messaging, args.locale, args.avatars, args.sites]): tools_manager.register_service(Service(TablesDB(client), "tables_db"))
- Constructs the MCP tool name by prefixing the service name ('tables_db') to the method name ('update'), resulting in 'tables_db_update'.# Get the overridden name if it exists tool_name = self._method_name_overrides.get(name, f"{self.service_name}_{name}")