Skip to main content
Glama

Delete approved drafts

delete_draft
Destructive

Permanently delete approved unsent drafts with a single-use preview token. Refuses the batch if any approved message is missing or no longer in Drafts; the action cannot be undone.

Instructions

Permanently delete the approved unsent drafts; only call after the user explicitly approved the preview. Cannot be undone.

Use it only with a token from preview_action(action="delete_draft") that the user approved. It deletes only drafts in Drafts, never other mail: to discard other mail, preview a move to Trash. Unless the operator turned it off, the user then confirms the exact change in the client's form.

Rechecks that every approved message is still in Drafts before any write; any missing or non-Drafts message refuses the whole batch. Deletes only the approved UIDs with UID STORE and UID EXPUNGE, requiring UIDPLUS.

Returns log_id, count, messages, partial, token_consumed and undo_supported=false. An expired, used or unknown token refuses: preview again.

Input Schema

NameRequiredDescriptionDefault
tokenYesSingle-use token from the preview the user approved.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds substantial context beyond them: irreversibility, single-use token semantics, whole-batch refusal when any message is missing or outside Drafts, the underlying UID STORE/UID EXPUNGE mechanism with a UIDPLUS requirement, client-side confirmation behavior, and undo_supported=false. That is exactly the kind of operational detail an agent needs before invoking a destructive tool.

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 approval gate, then operational detail, then return/failure behavior — a sensible ordering. It is dense and slightly long for one parameter, but each sentence carries distinct information rather than restating the schema.

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?

For a destructive, token-gated tool the description covers prerequisites, atomicity, guarantees, and failure modes thoroughly. The one redundancy is enumerating return fields (log_id, count, messages, partial, token_consumed) that the output schema already documents.

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% for the single `token` param, so the baseline is 3. The description goes further by explaining token provenance, single-use consumption, and what happens when a token is expired, used, or unknown — meaning the schema alone does not carry.

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+resource+scope: "Permanently delete the approved unsent drafts," and immediately distinguishes it from the nearest alternative by stating it deletes only drafts in Drafts and never other mail. An agent can tell this apart from `move`, `undo_action`, or `preview_action` 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 Guidelines5/5

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

Explicit preconditions: call only after the user approved the preview, only with a token from `preview_action(action="delete_draft")`, and the named alternative for non-draft mail is to preview a move to Trash. It also names the failure branch (expired/used/unknown token → preview again), leaving nothing to inference.

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