Rename or move a folder
rename_folderRename a folder, or move it under a different parent - in IMAP these are the same operation, because a folder's name is its path. Pass parent to reparent it while keeping its name. THE MESSAGES INSIDE COME WITH IT, and so do any sub-folders: renaming "Projects" also moves "Projects/Q1", and the result lists every child that moved. REFUSES to rename INBOX (on IMAP that empties your inbox into a new folder rather than renaming anything) and refuses to rename Sent, Drafts, Trash, Junk or Archive (mail clients find those by a flag, not by name, and renaming one can leave your sent mail split across two folders). It also refuses a name that is already taken rather than risk merging two folders. Read the refusal and tell the user what it says - each one is protecting something.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The folder to rename, e.g. "Projects" or "Archive/2025". | |
| parent | No | Move it under this existing folder, keeping `newName` as the leaf. Use this rather than building the path by hand when you only want to reparent it. | |
| newName | Yes | Its new name. A "/" makes a hierarchy, so "Archive/Projects" nests it under Archive. |