Skip to main content
Glama
langmail-mcp

langmail-mcp

Official
by langmail

Update draft

update_draft
Destructive

Modify a staged, unsent email draft to change recipients, subject, body, or attachments while preserving omitted fields and the draft ID.

Instructions

Edit a staged draft that has not been sent. Omitted fields keep their staged values; an empty recipient or attachments array clears that field. Files already attached are carried across untouched unless attachments is given, in which case the list is replaced wholesale — read the existing blobIds back with get_draft first if you mean to add one rather than swap them. The draftId stays the same across edits, so keep using the one create_draft returned. On a reply, text/html is the new part only: the quoted original is kept below it (quoteOriginal: false drops it, true adds one to a bare reply). On a forward staged with create_draft(forwardOf), text/html is the note only: the forwarded message is rebuilt below it. The previous version is not recoverable. If the draft has both a plain-text and an HTML body, pass both text and html or neither; replacing one would leave the other saying the old thing. The sender and the reply threading cannot be changed here; stage a new draft with create_draft instead, then retire this one with delete_draft.

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": {
      "draftId": "<draftId>"
    },
    "name": "update_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
ccNoReplace the Cc recipients. Omit to keep them; pass an empty array to clear them. Each entry is a bare address (person@example.com) or the "Name <person@example.com>" form.
toNoReplace the To recipients. Omit to keep them; pass an empty array to clear them. Each entry is a bare address (person@example.com) or the "Name <person@example.com>" form.
bccNoReplace the Bcc recipients. Omit to keep them; pass an empty array to clear them. Each entry is a bare address (person@example.com) or the "Name <person@example.com>" form.
htmlNoReplace the HTML body. On a reply, write only the new part: the quoted original is re-attached below it, so do not paste the quote from get_draft back in. Omit to keep the body.
textNoReplace the plain-text body. On a reply, write only the new part: the quoted original is re-attached below it, so do not paste the quote from get_draft back in. Omit to keep the body.
draftIdYesThe draft id, as returned by create_draft or list_drafts — edits do not change it — or a message id from search_emails with `mailbox: "Drafts"`. Editing a draft found that way returns the draftId to use from then on.
subjectNoReplace the subject. Omit to keep it.
attachmentsNoFiles to attach, at most 10. Each entry names its file either by `blobId` (already in the mailbox, or uploaded with upload_attachments — nothing passes through the conversation) or by base64 `content` (a small file you just generated); the `content` entries may come to at most 25 MB between them. A file path cannot be used: this server cannot read your disk — upload a local file with upload_attachments instead. Omit to keep the files already attached; pass an empty array to remove them all. Supplying the field replaces the whole list, so to add one more file, list the existing ones by the blobIds get_draft reports alongside the new one.
quoteOriginalNoOn a reply, with `text` or `html`: whether the original is quoted below the new text. Defaults to whatever the staged draft does — unless the same call adds a `to`/`cc`/`bcc` recipient the original was not addressed to, where quoting would forward it to them, so the quote is left off. Pass false to drop the quote, true to add it to a bare reply or to quote it for a new recipient.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true and idempotentHint=false, and the description reinforces this concretely with "The previous version is not recoverable." Beyond that it discloses merge semantics (omitted fields keep staged values, empty arrays clear), wholesale attachment replacement, and reply/forward body rebuild behavior — real behavioral context that annotations alone do not convey, though return format is not described and there is no output schema.

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 core edit/merge rule and irreversibility warning, then proceeds to the higher-risk edge cases (attachments, reply quoting, forward bodies, body pairing). It is a single dense paragraph and repeats some schema content about attachment replacement and quoteOriginal, costing a point.

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 9-parameter destructive mutation with no output schema, the description covers everything needed to call it correctly: field-merge semantics, attachment list replacement and the get_draft read-back step, reply/forward body composition, text/html pairing, id stability, and the immutability of sender and threading with an escape route.

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 description coverage is 100%, so the baseline is 3, but the description adds a rule absent from the schema: when a draft has both text and HTML bodies, pass both or neither. It also restates the draftId stability guarantee across edits, which is not a schema property.

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 a scope constraint: "Edit a staged draft that has not been sent." It is immediately distinguishable from create_draft, delete_draft and send_draft, and the closing sentence explicitly routes sender/threading changes to create_draft plus 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 Guidelines5/5

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

Gives explicit when-to-use and when-not-to-use guidance: read existing blobIds with get_draft before adding an attachment, stage a new draft with create_draft when the sender or threading must change, then retire the old one with delete_draft. Alternatives are named with the condition that selects them.

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