rename_note
Rename Markdown notes in Nextcloud Notes to update file names or organize them into categories, overwriting existing files when necessary.
Instructions
Rename a Markdown (.md) note inside Notes or a category. Overwrites the target if it already exists.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| new_filename | Yes | ||
| category | No |
Implementation Reference
- nextcloud_notes_mcp/server.py:176-190 (handler)The complete implementation of the 'rename_note' MCP tool, including registration via @mcp.tool() decorator, function signature (serving as schema), and the handler logic that renames a note using the WebDAV client's move method.@mcp.tool() def rename_note(filename: str, new_filename: str, category: str | None = None) -> str: """ Rename a Markdown (.md) note inside Notes or a category. Overwrites the target if it already exists. """ source_path = f"Notes/{category}/{filename}" if category else f"Notes/{filename}" target_path = f"Notes/{category}/{new_filename}" if category else f"Notes/{new_filename}" try: client.move(source_path, target_path, overwrite=True) except Exception as e: return f"Failed to rename note: {str(e)}" return f"Note renamed successfully: {source_path} → {target_path}"
- nextcloud_notes_mcp/server.py:176-176 (registration)Registration of the 'rename_note' tool using the FastMCP @mcp.tool() decorator.@mcp.tool()