Skip to main content
Glama

MCP Emails

Save an edited draft

draft_editor_save
Idempotent

Save the fields a person edited in the draft editor. Every field is optional and an omitted one keeps its stored value. No signature is applied, unlike the draft tool's 'update' when it is given a body: the text being saved is the text the person was shown, which already carries one if the inbox has one. Nothing is sent. On IMAP the save returns a NEW draft_id and the old one stops resolving. On IMAP and Gmail the save rebuilds the message from its text, so a draft with attachments, inline images other than its own signature images, or other extra parts is refused and left unchanged. A save against an older id of the draft, or against a revision other than base_revision, is refused as draft_changed and nothing is written.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ccNoReplacement recipient list. Omit to keep the stored one; pass [] to clear it.
toNoReplacement recipient list. Omit to keep the stored one; pass [] to clear it.
bccNoReplacement recipient list. Omit to keep the stored one; pass [] to clear it.
inboxNoThe inbox's email address, as an alternative to inbox_id.
subjectNoReplacement subject line. Omit to keep the stored one.
draft_idYesThe draft to act on. On IMAP a draft_id changes on every save, so use the one the most recent draft result returned.
inbox_idNoThe inbox holding the draft. Omit when the workspace has one inbox.
body_textNoReplacement plain-text body, written exactly as given. When the draft has an HTML part, the edit is made inside it when it can be placed exactly; otherwise a formatted HTML part is dropped (body.formatting_removed) and a plain one is regenerated, so both parts of the message say the same thing. Omit to keep the stored body.
base_revisionNoThe draft.revision of the copy being edited (0 when it had none). When the draft has been rewritten since, the save is refused as draft_changed.
add_attachmentsNoFiles to add, base64. The stored files are kept. 10 MB in all per save.
remove_attachmentsNoStored files to remove, by position in draft.attachments, each naming the file it means. Every other file is kept byte for byte. Refused as draft_changed when the file at that position is another one, and on Outlook, where a save cannot remove one.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardNoWhich card this envelope renders: 'draft_editor' or 'receipt'.
stateNoWhere the draft stands: editing, sent, cancelled (discarded, or the card was hidden or shown), or error.
dashboard_urlNoAbsolute link to the signed-in dashboard. Always present, and the one link that still works when the rest of the envelope cannot be parsed.
schema_versionNoCard envelope version. A client that does not know this version should fall back to dashboard_url.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / add_attachments
      Added value: +{
      +  "description": "Files to add, base64. The stored files are kept. 10 MB in all per save.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "description": "Standard base64.",
      +        "type": "string"
      +      },
      +      "filename": {
      +        "type": "string"
      +      },
      +      "mime_type": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "filename",
      +      "mime_type",
      +      "data"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
    • changedInput schema / properties / body_text / description
      Previous value: -"Replacement plain-text body, written exactly as given. When the draft has an HTML part it is regenerated from this text, so both parts of the message say the same thing. Omit to keep the stored body."New value: +"Replacement plain-text body, written exactly as given. When the draft has an HTML part, the edit is made inside it when it can be placed exactly; otherwise a formatted HTML part is dropped (body.formatting_removed) and a plain one is regenerated, so both parts of the message say the same thing. Omit to keep the stored body."
    • addedInput schema / properties / remove_attachments
      Added value: +{
      +  "description": "Stored files to remove, by position in draft.attachments, each naming the file it means. Every other file is kept byte for byte. Refused as draft_changed when the file at that position is another one, and on Outlook, where a save cannot remove one.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "filename": {
      +        "type": "string"
      +      },
      +      "index": {
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "size_bytes": {
      +        "minimum": 0,
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "index",
      +      "filename"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / state / description
      Previous value: -"Where the draft stands: editing, sent, or error."New value: +"Where the draft stands: editing, sent, cancelled (discarded, or the card was hidden or shown), or error."
  3. Changed1 schema field changed
    • addedInput schema / properties / base_revision
      Added value: +{
      +  "description": "The draft.revision of the copy being edited (0 when it had none). When the draft has been rewritten since, the save is refused as draft_changed.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  4. Added

TDQS

A3.6/5.0
Behavior1/5

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

The annotations declare idempotentHint=true, but the description says on IMAP the save returns a NEW draft_id and the old one stops resolving, so an identical repeated call would not have the same effect. This contradicts the annotation and triggers the annotation-contradiction rule despite the description otherwise adding rich behavioral detail.

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?

The description is dense but front-loads the purpose and proceeds through important caveats. Every sentence carries useful behavioral information, though the paragraph could be slightly tightened.

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 complex save operation across IMAP, Gmail, and Outlook, the description covers no-signature behavior, no sending, new draft_id behavior, rebuild limitations, and refusal conditions. With an output schema present, it need not explain return values.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents each parameter's meaning, including omit-to-keep semantics. The description adds only a blanket optionality rule, which is largely duplicative and slightly imprecise against the required draft_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?

States a specific verb and resource: saving fields edited in the draft editor. It distinguishes from the draft tool's update behavior and clarifies that nothing is sent, so an agent can identify its role without opening the schema.

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 clear context: use it after a person edits a draft in the draft editor. It also contrasts with the draft tool's update when a body is supplied, but does not explicitly enumerate alternatives or when-not-to-use beyond refusal cases.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.