Skip to main content
Glama
Xallor Email MCP

Xallor Email MCP

Official
by xallor-ai

edit_draft

Update an existing draft email by ID, changing only the fields you provide and replacing an exact Markdown section while preserving all other content.

Instructions

Edit an existing draft email by ID. Only the fields you provide are updated — unmentioned fields stay unchanged. Body edits work like an exact text edit: provide old_text copied from the current draft Markdown (draftMarkdown or a complete current read_email Markdown body) and new_text in Markdown only, without raw HTML, to replace that exact section. Use a blank line between paragraphs. The match must occur exactly once, and all unselected content — including reply/forward history — is preserved. Deprecated body is accepted only as an alias for new_text when old_text is also provided. Returns the draft ID and the draft's updated Markdown body (draftMarkdown). Does not support changing inReplyTo or forwardMessageId — those are set at creation time via draft_email. Returns the draft's shareable webUrl when available; recipients must have access to the mailbox to open it.

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>",
      "id": "<id>"
    },
    "name": "edit_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
ccNo
idYesDraft message ID to edit
toNo
bccNo
bodyNoDeprecated alias for `new_text`, in Markdown only; raw HTML is not supported. Use a blank line between paragraphs. Body-only full replacement is not supported; provide `old_text` with this field.
accountYes
subjectNo
new_textNoReplacement content for `old_text` in Markdown only; raw HTML is not supported. Use a blank line between paragraphs. The replacement is converted to HTML with optional `include_signature`, then inserted where `old_text` matched.
old_textNoExact current Markdown word, phrase or block to replace in the draft body. Copy from draftMarkdown or a complete current read_email Markdown body, never a truncated preview. Must match exactly once; unselected HTML is preserved. Unsafe structural selections are rejected.
new_attachmentsNoNew file attachments to add to the draft. The server reads the files from disk and base64-encodes them automatically.
include_signatureNoWhether to append the HTML signature to the replacement section: Gmail first, local fallback only when Gmail returns none; other providers use local. If true, don't include a signature in `new_text`/`body`. Only meaningful when replacement content is provided. Returns an error if true but no signature is configured for this account.
remove_attachmentsNoAttachment IDs to remove from the draft. Get attachment IDs from read_email.

Output Schema

NameRequiredDescriptionDefault
idYes
editedYes
webUrlNo
attachmentsNo
draftMarkdownNo
webUrlUnavailableReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses partial-update semantics, that unselected content including reply/forward history is preserved, that the match must occur exactly once, that unsafe structural selections are rejected, the deprecated `body` alias rule, and the return shape (draft ID, draftMarkdown, webUrl plus the recipient-access caveat). This is behavior an agent cannot infer from the 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 action and the partial-update rule, then the body-edit mechanics, then constraints on unsupported fields. It is somewhat dense and repeats "Markdown only, without raw HTML" and "blank line between paragraphs" across the description and schema, but no sentence is off-topic for a tool this intricate.

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 12-parameter mutation tool with no annotations, the description covers update semantics, matching rules, preservation guarantees, deprecations, unsupported fields, and signature behavior. An output schema exists, yet the return values (draftMarkdown, webUrl) are still noted briefly, so an agent has everything needed to invoke it correctly.

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 58%, and the description compensates well for the hard parameters — it explains the `old_text`/`new_text` pairing, the deprecated `body` alias, and that `include_signature` appends signature HTML only when replacement content exists. The gap is the recipient fields: the description never says whether supplying `to`/`cc`/`bcc` replaces or merges the existing list, and the schema has no descriptions for them either.

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+resource: "Edit an existing draft email by ID." It also positions itself against siblings by naming draft_email for creation-time fields and read_email as the source of the Markdown body, so an agent can tell edit from create, read, and send.

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 operating conditions: partial update ("only the fields you provide are updated"), the exact-match-once requirement for body edits, and a clear exclusion ("Does not support changing `inReplyTo` or `forwardMessageId` — those are set at creation time via `draft_email`"). It also tells the agent where to source `old_text` (draftMarkdown or a complete read_email body), which is real routing guidance.

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