ensure_notes_folder_exists
Create the /Notes folder in Nextcloud if it doesn't exist, ensuring a location for storing notes.
Instructions
Ensure that the /Notes folder exists in Nextcloud. Creates it if it doesn't exist.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- nextcloud_notes_mcp/server.py:52-59 (handler)The main handler function for the ensure_notes_folder_exists tool. It is decorated with @mcp.tool(), which registers it with the MCP server. The function calls the helper _ensure_remote_dir to create the /Notes folder if it does not exist.def ensure_notes_folder_exists() -> str: """ Ensure that the /Notes folder exists in Nextcloud. Creates it if it doesn't exist. """ _ensure_remote_dir("/Notes") return "/Notes folder exists or created successfully."
- nextcloud_notes_mcp/server.py:28-34 (helper)Helper function used by the ensure_notes_folder_exists tool to create a remote directory using the WebDAV client, ignoring if it already exists.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