Skip to main content
Glama
mattias242

protonmail-mcp-server

by mattias242

Ersätt utkast

update_draft
Destructive

Replaces an existing ProtonMail draft with a new version, keeps thread headers and attachments, and moves the old draft to Trash. Use it to edit a draft without sending it.

Instructions

Ersätt ett utkast i Drafts med en ny version. Ingenting skickas.

ERSÄTTS (anges på nytt i varje anrop, som i create_draft): to, subject, body, body_html, cc, bcc och reply_to. Ett fält som utelämnas blir tomt — ange alltså cc, bcc och body_html igen om de ska vara kvar. Avsändare, Date och Message-ID blir nya.

BEHÅLLS från det gamla utkastet:

  • In-Reply-To och References, så att ett svarsutkast (create_reply_draft) stannar i tråden;

  • alla delar som inte är brödtext: bilagor, bifogade mejl och inbäddade bilder (t.ex. originalets bilagor i ett vidarebefordringsutkast), byte för byte. Inbäddade bilder som body_html pekar på med cid: visas i HTML-versionen; utan body_html blir de vanliga bilagor.

Den nya versionen sparas först. Därefter flyttas det gamla utkastet till Trash (UID MOVE) — det raderas inte, så det går att återställa om något blev fel. Misslyckas sparandet ligger det gamla utkastet kvar orört. Utkastet får ett nytt UID. Bara utkast i Drafts kan uppdateras; hitta dem med list_emails(mailbox="Drafts") och läs dem med get_email.

Args: uid: Utkastets UID i Drafts (från create_draft eller list_emails) mailbox: Alltid "Drafts" — anges för att bekräfta att UID:t kommer därifrån to: Mottagaradress(er) — sträng eller lista subject: Ämnesrad body: Brödtext i klartext body_html: Valfri HTML-version av brödtexten cc: Kopia-adress(er) bcc: Hemlig kopia-adress(er) reply_to: Svarsadress

Returns: {"uid", "mailbox": "Drafts", "message_id", "replaced_uid", "replaced_moved_to": "Trash", "kept_headers", "kept_attachments"} där uid är det nya utkastets UID, replaced_uid det gamla (som nu ligger i Trash), kept_headers de trådheaders som fördes över och kept_attachments filnamnen (rensade från osynliga tecken, annars MIME-typen) för de delar som följde med.

Raises: ValueError: utkastet finns inte i Drafts, ogiltig adress eller ämnesrad (inget ändras), Bridge vägrar spara (det gamla ligger kvar), eller det gamla gick inte att flytta till Trash — nekat, timeout eller bruten anslutning. Då är det nya utkastet redan sparat: felet anger dess UID och Message-ID samt det gamla UID:t. Kör då INTE update_draft igen (det skapar ett utkast till).

Input Schema

NameRequiredDescriptionDefault
ccNo
toYes
bccNo
uidYes
bodyYes
mailboxYes
subjectYes
reply_toNo
body_htmlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.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 (destructiveHint=true only signals a write): it explains that omitted fields become empty and must be re-sent, which headers/parts are preserved byte-for-byte, the save-then-Trash-move ordering, the recoverability of the old draft, the new UID assignment, and the partial-failure state where the new draft is already saved. This is unusually rich behavioral disclosure for a mutation tool.

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 one-line purpose, then clearly partitioned by ERSÄTTS / BEHÅLLS / Args / Returns / Raises. The length is largely justified by the tool's complexity, though some prose (e.g. the cid/embedded-image nuance) is denser than strictly required.

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?

With no output schema, the description supplies the full return shape (new uid, replaced_uid, replaced_moved_to, kept_headers, kept_attachments) and the failure modes with the exact post-failure state. Combined with the annotations covering the safety profile, an agent has everything needed to call this correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full load, and it does: the Args block documents all 9 parameters including uid/mailbox semantics ('anger för att bekräfta att UID:t kommer därifrån'), accepted string-or-list forms for addresses, and the re-specification contract for cc/bcc/body_html. No meaningful parameter is left ambiguous.

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 precise verb+resource ('Ersätt ett utkast i Drafts med en ny version') and immediately scopes the effect ('Ingenting skickas'), which cleanly separates it from send_draft, create_draft and create_reply_draft. The agent can identify the operation 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 Guidelines5/5

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

Explicitly limits applicability ('Bara utkast i Drafts kan uppdateras') and routes the agent to the correct discovery path ('hitta dem med list_emails(mailbox="Drafts") och läs dem med get_email'). It also states a negative rule — do NOT re-run update_draft if the Trash move failed — which is exactly the when-not guidance this dimension rewards.

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