create_folder
Create a new folder in your Obsidian vault by specifying the folder path.
Instructions
Create a new folder in the vault.
Args: folder_path: Path to the new folder (e.g., "projects/new-project/")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder_path | Yes |
Implementation Reference
- server.py:271-290 (handler)MCP tool handler for create_folder. This is the entry point that validates read-only mode, gets the vault client, and delegates to the client's create_folder method. Returns success/error dict.
@mcp.tool() def create_folder(folder_path: str) -> dict: """Create a new folder in the vault. Args: folder_path: Path to the new folder (e.g., "projects/new-project/") """ try: if is_read_only(): return read_only_error() client = get_vault_client() success = client.create_folder(folder_path) if success: return {"success": True, "message": f"Folder created: {folder_path}"} else: return {"error": f"Folder already exists: {folder_path}"} except Exception as e: return {"error": str(e)} - server.py:271-272 (registration)The @mcp.tool() decorator registers create_folder as an MCP tool with the FastMCP server.
@mcp.tool() def create_folder(folder_path: str) -> dict: - obsidian_client.py:255-263 (helper)Actual implementation in ObsidianVaultClient. Resolves the vault-relative path, checks if it already exists (returns False), and creates the directory with parents=True.
def create_folder(self, folder_path: str) -> bool: """Create a new folder in the vault.""" folder = self._resolve_vault_path(folder_path) if folder.exists(): return False folder.mkdir(parents=True, exist_ok=True) return True