Rename folder
rename_folderRename a folder in a mailbox. Give the new name on its own, without the parent path: the folder stays under the same parent and keeps its messages and subfolders. The new name must not be one another folder has. In Gmail, where the folder is a label, the labels nested under it are renamed to match. System folders such as Inbox, Sent and Trash can't be renamed, and neither can a folder the account settings use as one. In an IMAP mailbox, the folder and its subfolders get new IDs, so use the ID in the result or list the folders again. Message IDs normally stay the same. If one stops working, list the folder again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"folder": "<folder>",
"name": "<name>"
},
"name": "rename_folder"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New name for the folder itself, without its parent path. For Projects/2025, give 2026 to get Projects/2026. | |
| folder | Yes | ID of the folder to rename, as list_folders returns it, or the folder name. | |
| accountId | No | Account to operate on. Optional when exactly one account is connected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |