tables_db_create_integer_column
Add an integer column to an Appwrite database table with optional constraints like minimum/maximum values and default settings.
Instructions
Create an integer column. Optionally, minimum and maximum values can be provided.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID. | |
| table_id | Yes | Table ID. | |
| key | Yes | Column Key. | |
| required | Yes | Is column required? | |
| min | No | Minimum value | |
| max | No | Maximum value | |
| default | No | Default value. Cannot be set when column is required. | |
| array | No | Is column an array? |
Implementation Reference
- Generic handler that dispatches to the Appwrite SDK method for the tool. For tables_db_create_integer_column, bound_method is TablesDB.create_integer_column.@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)}")]
- src/mcp_server_appwrite/server.py:71-71 (registration)Registers the TablesDB Appwrite service with prefix 'tables_db', enabling automatic tool generation for its methods including create_integer_column as 'tables_db_create_integer_column'.tools_manager.register_service(Service(TablesDB(client), "tables_db"))
- Generates the tool name by prefixing service_name (tables_db) to the method name (create_integer_column). Also generates input schema from type hints and docstrings.# Get the overridden name if it exists tool_name = self._method_name_overrides.get(name, f"{self.service_name}_{name}")
- src/mcp_server_appwrite/server.py:13-13 (registration)Imports the TablesDB class from Appwrite SDK, whose methods become MCP tools.from appwrite.services.tables_db import TablesDB
- ToolManager method that registers a service by adding its dynamically generated tools to the registry.def register_service(self, service: Service): """Register a new service and its tools""" self.services.append(service) self.tools_registry.update(service.list_tools())