Skip to main content
Glama

Revise draft

update_draft
Destructive

Patch a draft created by this project only when expected revision matches; keep omitted fields, replace attachments only if provided, and re-read the draft on conflict.

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.

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. 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."
  2. First observedv0.11.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the optimistic-concurrency contract via expected_revision, the exact failure mode (draft_conflict) and its common cause (saved in a mail app), and the destructive nuance that changes.attachments replaces the entire list and [] removes all. That tells the agent precisely what destructiveHint=true means in practice.

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?

Four compact sentences, each carrying a distinct rule: identity/scope, merge semantics, conflict behavior, and eligibility. The constraint is front-loaded and nothing is redundant with the schema.

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 destructive, non-idempotent mutation with nested parameters, it covers scope, merge semantics, error handling, retry procedure, and eligibility. With an output schema present, return values need no explanation here.

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: expected_revision acts as a staleness guard, omitted fields including attachments are preserved, and attachments is replace-not-merge. It does not re-explain the per-field payload shapes, which is fine given the schema already does.

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?

Names a specific verb and resource ("Patch a draft this project created") and immediately scopes it to drafts originating from create_draft, which separates it from create_draft, get_draft, and update_messages 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?

Explicitly states when this tool applies (drafts created by create_draft) and what to do otherwise ("for any other draft create a new one"), plus a recovery path on conflict ("re-read it with get_draft before trying again"). Alternatives and conditions are named rather than inferred.

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