Skip to main content
Glama

Revise draft

update_draft
Destructive

Patch a draft created by this project using an expected revision, preserving omitted fields and replacing attachments only when supplied. Re-read after a conflict or stale revision before retrying.

Instructions

Patch a draft this project created, conditional on expected_revision. Omitted fields are kept, including attachments; changes.attachments replaces the whole list ([] removes all). Fails with draft_conflict if the draft changed elsewhere (for example saved in a mail app) or the revision is stale; re-read it with get_draft before trying again. Only drafts created by create_draft can be patched; for any other draft create a new one. changes.body_text replaces only your text: the signature and the quote or forward block below it stay (get_draft's composition shows them); changes.signature switches or removes the signature.

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": {
      "account": "<account>",
      "draft_id": "<draft_id>",
      "expected_revision": "<expected_revision>",
      "changes": "<changes>"
    },
    "name": "update_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
accountYesMailbox alias or email address from list_accounts.
changesYesFields to change; omitted fields keep their value.
draft_idYesDraft id from create_draft or list_drafts.
expected_revisionYesRevision from create_draft, get_draft or the last update_draft; a mismatch fails with draft_conflict.

Output Schema

NameRequiredDescriptionDefault
draft_idNo
revisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.20.2
    • changedInput schema / properties / changes / properties / body_text / description
      Previous value: -"New plain-text body (at most 500 KB)."New value: +"New plain-text body above the signature and quote (at most 500 KB)."
    • addedInput schema / properties / changes / properties / signature
      Added value: +{
      +  "description": "true: the sender's default signature; false: none; a name from list_signatures: that one. Omitted: keep the current signature (re-rendered when body_text changes).",
      +  "type": [
      +    "boolean",
      +    "string"
      +  ]
      +}
  2. Changed14 schema fields changed
    • addedInput schema / properties / changes / description
      Added value: +"Fields to change; omitted fields keep their value."
    • addedInput schema / properties / changes / properties / attachments / items / properties / account / description
      Added value: +"Reference: mailbox alias of that message (with message_id)."
    • addedInput schema / properties / changes / properties / attachments / items / properties / content_base64 / description
      Added value: +"Inline: the file content, base64 encoded."
    • addedInput schema / properties / changes / properties / attachments / items / properties / filename / description
      Added value: +"Inline: file name."
    • addedInput schema / properties / changes / properties / attachments / items / properties / message_id / description
      Added value: +"Reference: message id (with account)."
    • changedInput schema / properties / changes / properties / attachments / items / properties / mime_type / description
      Previous value: -"type/subtype, e.g. application/pdf"New value: +"Inline: type/subtype, e.g. application/pdf"
    • addedInput schema / properties / changes / properties / attachments / items / properties / ref / description
      Added value: +"Reference: opaque ref from search_messages of the message holding the attachment."
    • addedInput schema / properties / changes / properties / bcc / description
      Added value: +"New Bcc list (email addresses, at most 50)."
    • addedInput schema / properties / changes / properties / body_text / description
      Added value: +"New plain-text body (at most 500 KB)."
    • addedInput schema / properties / changes / properties / cc / description
      Added value: +"New Cc list (email addresses, at most 50)."
    • addedInput schema / properties / changes / properties / subject / description
      Added value: +"New subject line."
    • addedInput schema / properties / changes / properties / to / description
      Added value: +"New To list (email addresses, at most 50)."
    • addedInput schema / properties / draft_id / description
      Added value: +"Draft id from create_draft or list_drafts."
    • addedInput schema / properties / expected_revision / description
      Added value: +"Revision from create_draft, get_draft or the last update_draft; a mismatch fails with draft_conflict."
  3. First observedv0.11.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and non-idempotence; the description explains precisely why — attachment lists are wholesale replaced, omissions preserve current values, and stale revisions fail with draft_conflict rather than silently overwriting. It also discloses the ownership precondition (project-created drafts only) and the composition behavior around signatures and quoted blocks, which goes well beyond the annotations.

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 action and its precondition, and nearly every clause carries distinct information (replacement semantics, conflict recovery, ownership restriction, body composition). It is a dense single paragraph of chained clauses, so readability suffers slightly, but there is little that could be cut without losing guidance.

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 nested-object mutation with four required parameters and an output schema, the description covers the risk profile, the conflict/recovery loop, list-replacement semantics, and the signature/quote composition rule. Nothing an agent needs in order to call it correctly is missing.

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 adds real meaning the schema does not: omitted fields are kept, changes.attachments replaces the entire list ([] clears it), and changes.body_text replaces only the author's text while signature and quote/forward blocks persist. Those semantics materially change how the agent should compose a patch.

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 with scope: "Patch a draft this project created, conditional on expected_revision." It also names the sibling boundaries explicitly (drafts from create_draft only, vs. creating a new draft), so an agent can distinguish it from create_draft/get_draft/delete_draft without opening schemas.

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 (only drafts created by create_draft) and when-not (any other draft → create a new one). It also routes the agent on the failure path: on draft_conflict, re-read with get_draft before retrying, which is exactly the recovery guidance an agent needs.

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