Skip to main content
Glama

mail_update_draft

Edit an existing email draft by saving a new version and moving the old one to Trash; only specified fields change, and nothing is sent.

Instructions

Change a draft saved in Drafts by saving a new version and moving the old one to Trash; only the fields you pass change, and nothing is sent.

Use when: the owner wants edits to a draft before it goes out. Not for sending it (use mail_send_draft with the new uid), starting a new draft (use mail_send_message with draft=true), or changing mail already sent (not possible). Parameters:

  • uid and uidvalidity come from mail_search_messages(folder='Drafts'). Omit folder for Drafts; elsewhere the message must carry the \Draft flag.

  • Omitted to, cc, bcc and subject keep their values.

  • Omit both body and body_html to keep the text. body alone replaces it and drops any old HTML part; body_html alone leaves the plain-text part empty, so pass both for a formatted draft. The signature is appended when either is given.

  • attachments replaces every file; [] removes them all; omit it to keep them. Behavior:

  • The new version is saved before the old one goes to Trash, so a failure never loses the draft.

  • The old uid is dead afterwards: use the returned uid.

  • Reply threading headers are kept.

  • No recipient checks and no approval apply.

  • Each call makes another version. Returns: {status: draft_updated, folder, old_uid, old_draft, message_id, subject, to, cc, uid, uidvalidity}; when the server reports no new uid, a hint to find it with mail_search_messages replaces uid. Errors:

  • 'No message with uid' or out-of-date uids: search Drafts again.

  • 'is not a saved draft', an unusable address, or an oversized attachment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ccNoCc addresses (visible to all recipients).
toNoNew recipients; omit to keep.
bccNoBcc addresses (hidden from other recipients).
uidYesThe draft's uid in Drafts.
bodyNoNew plain-text body (the signature is added); omit to keep the current body.
folderNoWhere the draft is; default Drafts.Drafts
subjectNoNew subject; omit to keep.
body_htmlNoOptional HTML version of the body; the plain-text 'body' is always required.
attachmentsNoFiles to attach (from mail_get_attachment as is; from drive_get_file, name and data_base64 go in filename and content_base64).
uidvalidityYesThe 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "mail_update_draftDictOutput",
      -  "type": "object"
      -}New value: +null
  2. Addedv0.11.0

TDQS

A5/5.0
Behavior5/5

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

Beyond annotations, it discloses operational safety behavior: the new version is saved before the old is trashed, the old uid becomes dead, reply threading headers are kept, no recipient checks or approval apply, and each call creates another version. This adds rich context consistent with the annotations and leaves no surprising mutation behavior undisclosed.

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?

The description is long but well structured into purpose, Use when, Parameters, Behavior, Returns, and Errors. Every section earns its place for a complex 10-parameter mutation tool, and the most important purpose and routing information is front-loaded.

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?

With no output schema, the description supplies the return shape, special return cases, and error guidance. Combined with its parameter and behavioral coverage, it is complete enough for an agent to use the tool correctly without opening sibling documentation.

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

Parameters5/5

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

Although schema coverage is already 100%, the description adds significant relational semantics not captured by individual field descriptions: uid/uidvalidity sourcing, folder defaults, omitted field preservation, body/body_html interaction rules, signatures, and attachment replacement semantics. This materially improves correct invocation.

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?

The description states a specific verb and resource ('Change a draft saved in Drafts'), including the unusual save-new-version/move-old-to-Trash behavior. It distinguishes itself from siblings by explicitly saying what it is not for: sending, starting a draft, or changing sent mail.

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?

It gives explicit when-to-use guidance ('the owner wants edits to a draft before it goes out') and names the correct alternatives: mail_send_draft for sending, mail_send_message with draft=true for a new draft, and notes changing sent mail is not possible.

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