Delete folder
delete_folderDelete an empty mailbox folder after removing its messages and subfolders. Call list_folders to get the folder ID; Gmail labels are removed from messages, and system folders cannot be deleted.
Instructions
Delete an empty folder from a mailbox. The folder must have no messages and no subfolders: move or trash its mail and delete its subfolders first. In Gmail, where the folder is a label, remove the label from its messages. System folders such as Inbox, Sent and Trash can't be deleted, and neither can a folder the account settings use as one. Call list_folders first to find the folder ID.
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": "delete_folder"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | Yes | ID of the folder to delete, 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 |