Sign inGet started
Menu
TOOL REFERENCE / SOURCE GENERATEDMAILMAN MCP / MAIL

email_delete_folder

Deletes a folder from one mailbox. Confirm with the user first, and check email_list_folders for what is inside it. With delete_contents false (the default) a folder that still holds messages returns FOLDER_NOT_EMPTY and nothing is deleted — move the messages out with email_bulk_modify_messages, then retry. With delete_contents true the messages go too. System folders such as Inbox, Sent and Trash cannot be deleted and return SYSTEM_FOLDER_PROTECTED; the system flag on each folder tells you which those are. idempotency_key is required.

Input fields

{
  "type": "object",
  "properties": {
    "account_id": {
      "type": "string",
      "minLength": 1,
      "description": "The connected mailbox to act on, from email_accounts_list. Never guess this value and never reuse one across mailboxes — it selects both the credential and the permission set the call runs under."
    },
    "folder_id": {
      "type": "string",
      "minLength": 1,
      "description": "A folder id from email_list_folders, not a folder name."
    },
    "delete_contents": {
      "description": "Default false. Left false, deleting a non-empty folder fails with FOLDER_NOT_EMPTY and nothing is touched. Set true only after the user has agreed to lose the messages inside it.",
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 1,
      "description": "A unique value you generate for this attempt, e.g. a UUID. Retrying with the same key returns the original result instead of acting twice. Reusing a key with different arguments is an IDEMPOTENCY_CONFLICT."
    }
  },
  "required": [
    "account_id",
    "folder_id",
    "idempotency_key"
  ]
}

Tool behavior

May change provider state. Check the explicit account, required access and provider capabilities before invoking.

Inspect isError and per-account errors. General write tools do not all enforce exact-plan approval. This reference does not certify any current AI client version.

YOUR AI POSTAL SYSTEM

YOUR INBOXES.
UNDER CONTROL.

Get started

Start with a free account and one read-only search. Existing accounts keep their connection.