Skip to main content
Glama

Delete folder

delete_folder
DestructiveIdempotent

Delete 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

NameRequiredDescriptionDefault
folderYesID of the folder to delete, as list_folders returns it, or the folder name.
accountIdNoAccount to operate on. Optional when exactly one account is connected.

Output Schema

NameRequiredDescriptionDefault
dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.31.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, but the description adds real behavioral context on top: the emptiness precondition, the immutability of system folders, and the Gmail-specific side effect of stripping the label from messages. It does not contradict the annotations, though it could say what error results when the folder is non-empty.

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?

Three tight sentences, front-loaded with the core action and then the preconditions in the order the agent needs them. No filler or restatement of the name.

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

Completeness4/5

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

An output schema exists, so return values need not be explained, and the description covers preconditions, protected targets and ID resolution. The missing piece is disambiguation from delete_label, which matters given Gmail's folder-as-label model.

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, but the description still adds provenance for the folder parameter ('as list_folders returns it') and tells the agent to resolve the ID via list_folders before calling. accountId is left entirely to the schema, which documents it adequately.

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?

States a specific verb and resource plus its defining constraint: 'Delete an empty folder from a mailbox.' An agent immediately knows this removes folder containers, not messages, and can distinguish it from move_folder or delete_draft.

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 explicit preconditions and sequencing: 'move or trash its mail and delete its subfolders first' and 'Call list_folders first to find the folder ID', plus clear exclusions (system folders, account-settings folder cannot be deleted). The one gap is that it never distinguishes itself from the sibling delete_label, which in Gmail is effectively the same operation on the same object.

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