Skip to the documentation
MCP server

Drafts

Unsent messages saved in the mailbox.

Drafts tools

ToolWhat it does
listDraftsThe drafts, most recently saved first, each with its subject, recipients and sender. query searches them.
getDraftOne draft in full: its sender, recipients, subject, the thread it replies to, its attachments and its body.
createDraftSave a new draft without sending it. Every field is optional, threadId makes it a reply, and forwardOf with it forwards a message of that thread.
updateDraftChange fields on a draft. A field you leave out keeps its value, and a list replaces the saved one whole.
deleteDraftDelete a draft for good. It does not go to the Bin.

Reading needs “Read drafts” (drafts:read) and saving, changing or deleting needs “Create and edit drafts” (drafts:write). A client limited to some addresses sees only the drafts from them, and a draft it saves needs a from it may send as.

In the app’s chat, saving, changing and deleting a draft ask first unless you asked for them.

Reference

listDrafts

Scopesdrafts:readThe app's assistant runs it without askingToolkitdrafts

The unsent drafts in the mailbox, most recently saved first, each with its id, subject, recipients and sender. query searches the subject, the sender and the start of the body. When more follow, the last line gives a pageToken: call again with the same query and that pageToken.

Inputs

querystring
limitinteger
At least 1At most 100
pageTokenstring

Also available in

API
GET /drafts
TypeScript
nextmail.drafts.list()nextmail.drafts.listAll()nextmail.drafts.iterate()
Python
drafts.list()drafts.list_all()drafts.iterate()
Ruby
drafts.listdrafts.list_alldrafts.iterate
PHP
drafts->listdrafts->listAlldrafts->iterate
Go
Drafts.ListDrafts.ListAllDrafts.Iterate
Java
drafts().listdrafts().listAlldrafts().iterate
C#
Drafts.ListAsyncDrafts.ListAllAsyncDrafts.IterateAsync

createDraft

Scopesdrafts:writeThe app's assistant asks first unless you asked for itToolkitdrafts

Save a new draft without sending it, as the composer does when you close it. Every field is optional, and html wins over text when both are given. from is the address it will be sent as, and threadId makes it a reply to that thread. To forward an email, pass threadId and forwardOf, the id of the message in it: the draft takes the names of its files and a "Fwd:" subject unless you give one, and sending it quotes the message below what you wrote and attaches its files. sendEmail with the draft id sends it later.

Inputs

tostring[]
ccstring[]
bccstring[]
subjectstring
Up to 998 characters
htmlstring
Up to 1000000 characters
textstring
Up to 1000000 characters
fromstring
threadIdstring
forwardOfstring

To forward an email: the id of the message in threadId, from getThread. Needs threadId.

1 to 998 characters

Also available in

API
PATCH /drafts/{id}POST /drafts
TypeScript
nextmail.drafts.update()nextmail.drafts.create()
Python
drafts.update()drafts.create()
Ruby
drafts.updatedrafts.create
PHP
drafts->updatedrafts->create
Go
Drafts.UpdateDrafts.Create
Java
drafts().updatedrafts().create
C#
Drafts.UpdateAsyncDrafts.CreateAsync

updateDraft

Scopesdrafts:writeThe app's assistant asks first unless you asked for itToolkitdrafts

Change fields on a saved draft. A field you leave out keeps its value, and a list you give replaces the saved one whole, so to with one address drops the others. from null clears the sender. Take the id from listDrafts.

Inputs

draftIdstringRequired
Not empty
tostring[]
ccstring[]
bccstring[]
subjectstring
Up to 998 characters
htmlstring
Up to 1000000 characters
textstring
Up to 1000000 characters
fromstring
Can be null
threadIdstring

Also available in

API
PATCH /drafts/{id}POST /drafts
TypeScript
nextmail.drafts.update()nextmail.drafts.create()
Python
drafts.update()drafts.create()
Ruby
drafts.updatedrafts.create
PHP
drafts->updatedrafts->create
Go
Drafts.UpdateDrafts.Create
Java
drafts().updatedrafts().create
C#
Drafts.UpdateAsyncDrafts.CreateAsync