mail_update_folder
Rename an existing iCloud Mail folder while keeping its messages in place. Use when the owner asks to change a folder name, not to create, delete, or move messages.
Instructions
Rename one of the owner's own mail folders; the mail inside stays in it under the new name.
Use when: the owner asks to rename a folder. Not for creating one (use mail_create_folder), removing one (use mail_delete_folder), or moving messages between folders (use mail_move_messages). Parameters:
name: an existing folder from mail_list_folders; an exact match is tried first, then a case-insensitive one.
new_name: the full new name, trimmed of spaces; it must be non-empty and not already used by another folder, ignoring case.
A case-only change of the same folder is allowed. Behavior:
Refuses INBOX, Notes and the system folders (anything flagged Sent, Drafts, Trash, Junk, Archive, All or Flagged, and the usual names such as Sent Messages, Deleted Messages and Spam).
Refuses a folder that has subfolders.
Moves and deletes no mail.
Repeating it has no further effect: the old name is gone, so a second call fails with 'There is no folder'. Returns: {renamed: true, from, to} with the exact old and new names. Errors: 'There is no folder' (check mail_list_folders), 'one of the mailbox's own folders', 'has subfolders' (rename or delete those first), 'already exists', or 'new_name is empty'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The folder to rename (exact name from mail_list_folders). | |
| new_name | Yes | Its new name. |