Skip to main content
Glama

delete_folder

Destructive

Deletes a mailbox folder and the messages it contains; requires two-phase human approval to preview and confirm the destructive action.

Instructions

Delete a mailbox folder, including the messages it contains. TWO-PHASE, HUMAN-APPROVED: the first call (no request_id) executes nothing — it returns status=approval_required with a preview of exactly what would happen and a request_id. A human approves out of band (GigaMail console, CLI or Telegram, behind Windows Hello / Touch ID); the second call with that request_id executes the payload that was approved (the approved arguments, not the ones passed the second time). Requests expire (default 15 min); identical pending requests are deduplicated; more than 20 requests/hour per tool are refused (status=rate_limited). Every phase is written to the audit log. The preview shows the folder_id. Returns {success}. Destructive for every message inside the folder: move them out first if they matter.

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_id": "<folder_id>"
    },
    "name": "delete_folder"
  }
}

Input Schema

NameRequiredDescriptionDefault
folder_idYesFolder id (Graph) or name (IMAP) from list_folders. System folders (Inbox, Sent...) cannot be deleted.
account_idNoAccount to operate on (integer id from list_accounts). Omit or null = the user's active account.
request_idNoOmit on the first call. On the first call the tool does NOT execute: it returns status=approval_required, a preview and a request_id. A human must approve that request_id out of band (GigaMail console, `gigamail approvals approve`, or Telegram — all behind Windows Hello / Touch ID / Linux PIN). Then call again with the same request_id to execute. The agent cannot approve; repeating the call without approval just returns awaiting_approval.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.8
    • changedInput schema / properties / request_id / description
      Previous value: -"Omit on the first call. On the first call the tool does NOT execute: it returns status=approval_required, a preview and a request_id. A human must approve that request_id out of band (GigaMail console, `gigamail approvals approve`, or Telegram — all behind Windows Hello / Touch ID). Then call again with the same request_id to execute. The agent cannot approve; repeating the call without approval just returns awaiting_approval."New value: +"Omit on the first call. On the first call the tool does NOT execute: it returns status=approval_required, a preview and a request_id. A human must approve that request_id out of band (GigaMail console, `gigamail approvals approve`, or Telegram — all behind Windows Hello / Touch ID / Linux PIN). Then call again with the same request_id to execute. The agent cannot approve; repeating the call without approval just returns awaiting_approval."
  2. Changed3 schema fields changedv0.3.0
    • addedInput schema / properties / account_id / description
      Added value: +"Account to operate on (integer id from list_accounts). Omit or null = the user's active account."
    • addedInput schema / properties / folder_id / description
      Added value: +"Folder id (Graph) or name (IMAP) from list_folders. System folders (Inbox, Sent...) cannot be deleted."
    • addedInput schema / properties / request_id / description
      Added value: +"Omit on the first call. On the first call the tool does NOT execute: it returns status=approval_required, a preview and a request_id. A human must approve that request_id out of band (GigaMail console, `gigamail approvals approve`, or Telegram — all behind Windows Hello / Touch ID). Then call again with the same request_id to execute. The agent cannot approve; repeating the call without approval just returns awaiting_approval."
  3. First observedv0.1.3

TDQS

A4.7/5.0
Behavior5/5

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

Far beyond the annotations: discloses the approval gate, out-of-band human approver channels, expiry (15 min default), dedup of identical pending requests, a 20/hour rate limit with the exact status=rate_limited signal, audit logging, and the {success} return. Crucially it warns that the second call executes the approved arguments rather than the ones passed the second time — a non-obvious behavior no annotation conveys.

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

Conciseness5/5

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

Front-loaded with the action and destructiveness, then the approval workflow, then operational limits, then the warning. Dense but every sentence carries distinct operational information; nothing is redundant padding.

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, open-world mutation with no output schema, the definition covers the safety gate, failure statuses, rate limits, audit trail, return shape, and data-loss warning. An agent has everything needed to call it correctly and to avoid looping on an unapproved request.

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 baseline is 3; the description earns above that by explaining that folder_id appears in the preview and by clarifying that request_id re-executes the previously approved payload, a semantic trap the schema states but the description reinforces in workflow context. It adds no new meaning for account_id.

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 plus scope: 'Delete a mailbox folder, including the messages it contains.' The blast radius (folder contents) is stated immediately, so an agent can distinguish this from delete_message or delete_event by resource alone.

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?

Explains the two-phase procedure in order (first call previews, human approves, second call with request_id executes), which is the essential usage contract. It also hints at the safer alternative ('move them out first if they matter') but does not name a concrete sibling tool or state exclusions such as system folders here (that lives only in the schema).

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