create_category
Create a new category in Nextcloud Notes by generating a subdirectory to organize your notes efficiently.
Instructions
Create a new category inside Notes by creating a subdirectory.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category_name | Yes |
Implementation Reference
- nextcloud_notes_mcp/server.py:192-200 (handler)The create_category tool handler, decorated with @mcp.tool(). Creates a category by ensuring the remote directory /Notes/{category_name} exists.@mcp.tool() def create_category(category_name: str) -> str: """ Create a new category inside Notes by creating a subdirectory. """ full_path = f"Notes/{category_name}" _ensure_remote_dir(full_path) return f"Category created successfully: {full_path}"
- nextcloud_notes_mcp/server.py:28-35 (helper)_ensure_remote_dir helper function called by create_category to create the category directory if it doesn't exist.def _ensure_remote_dir(path: str): """Ensure that a remote directory exists in Nextcloud.""" try: client.mkdir(path) except Exception: # Folder probably already exists → ignore pass