Skip to main content
Glama
proton-mail-mcp

proton-mail-mcp

by sethbang

Delete folder

delete_folder
DestructiveIdempotent

Delete a mailbox folder or label container while protecting system mailboxes. Move its messages to another folder first, or preview affected nested folders and message counts with a dry run.

Instructions

Delete a mailbox folder or label container. Restricted to the "Folders/" and "Labels/" namespaces to protect system mailboxes (INBOX, Sent, Trash, etc.).

Deleting a folder does not delete its messages, but it takes them out of every folder: they stay findable only in "All Mail", which is easy to lose track of. Pass moveContentsTo (e.g. "Archive" or "INBOX") to move the folder's mail, nested folders included, there first, and dryRun: true to see the nested folders and message counts beforehand. Nested folders are deleted with it. Deleting a label only removes the label; its messages stay in their folders.

Accepts . and .. path segments by design — IMAP treats paths as opaque literal names with no parent-directory semantics, so this is the cleanup path for adversarial folder names left behind by other IMAP clients (or older versions of this server). create_folder and rename_folder reject those segments so confusable paths cannot be introduced through this tool.

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": {
      "path": "<path>"
    },
    "name": "delete_folder"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to delete (e.g. "Folders/Old", "Labels/Archived"). Must start with "Folders/" or "Labels/".
dryRunNoShow the nested folders and message counts that would be affected, without deleting.
moveContentsToNoFolders only: move all of the folder's mail (nested folders included) to this folder before deleting, e.g. "Archive" or "INBOX". If a move fails, nothing is deleted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.0.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "default": false,
      +  "description": "Show the nested folders and message counts that would be affected, without deleting.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / moveContentsTo
      Added value: +{
      +  "description": "Folders only: move all of the folder's mail (nested folders included) to this folder before deleting, e.g. \"Archive\" or \"INBOX\". If a move fails, nothing is deleted.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv1.0.1

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructive=true and idempotent=true, but the description goes well beyond them: it explains that messages are not deleted yet become findable only in All Mail, that nested folders are removed with the parent, and that a failed move aborts the delete. It also pre-empts confusion about '.'/'..' path segments by explaining why they are accepted here but rejected by create_folder and rename_folder.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and the namespace restriction, then consequences, then remediation options. The final paragraph on adversarial folder names is lengthy relative to its importance, but it earns most of its space by resolving a genuinely surprising path behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, no-output-schema mutation tool, the description covers what is removed, what is preserved, how to preserve it, how to preview it, and failure atomicity. An agent has everything needed to call it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds value by clarifying that moveContentsTo applies to folders only and includes nested folders, and by explaining the opaque-literal path semantics for '.'/'..' that the schema's path description does not cover.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('Delete a mailbox folder or label container') and immediately scopes it to the Folders/ and Labels/ namespaces, which distinguishes it from delete_message, delete_thread, and bulk_delete without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear conditions for the two optional parameters (moveContentsTo to preserve mail, dryRun to preview nested folders and counts) and explains the label-vs-folder consequence. It stops short of naming an alternative for deleting the messages themselves, so it is strong context rather than a full when/when-not routing guide.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.