Skip to the documentation
MCP server

Writing

Composing, translating and sending.

Writing tools

ToolWhat it does
composeEmailWrite the body of an email with AI from a prompt, and with threadId as a reply in that thread. Returns the text; it saves no draft.
sendEmailSend a new email. translateTo writes it in the recipient’s language; includeOriginal (default true) keeps what you wrote beneath the translation.
previewTranslationWhat translateTo would produce (the translated subject and the exact body sendEmail would put on the wire), with nothing sent and nothing stored.
listTranslationLanguagesEvery language translateTo accepts, optionally filtered by a fragment of a code, an English name or the language’s own name.
replyToEmailReply inside a thread. It works out who the reply goes to (the sender, or everyone on To and Cc when replyAll is true, never your own addresses), the Re: subject, the threading headers, the quoted history, and the address that received the message, which it sends from. It needs permission to send and to read threads.
checkEmailHow a receiving mailbox would likely rate a message before it is sent: a spam score, a phishing score and an AI-writing score, each 0 to 100, with what raised each one. Nothing is sent or stored, and it never calls a model.
rewriteEmailUp to five versions of a subject or a body: shorter, longer, rephrased, more formal, more casual, or as an instruction says. Spends one AI action.
suggestSubjectA short subject line for the body of an email. Spends one AI action.
getReplySuggestionsUp to three short replies to the latest message of a thread, the ones the reading pane offers: a label of a few words and the reply itself, in the language of that message. Kept until another message arrives, none when the message needs no reply, and it spends no AI action.
readVerificationCodeThe sign-in or verification code in a message you pass in, as raw MIME source or as a subject with html or text. It answers only when it is sure, so a message with two different codes or a number that could be an order gives no code. It needs no permission and never calls a model.

sendEmail takes recipients, subject, body, a from address, and optionally a thread or draft id. It does not currently accept attachments or custom headers. There is no fallback sender, so a send must name the address it goes out as, and one with from left out is refused. A draft id with no from sends as the address that draft was saved with, and is refused when the draft holds none.

Saving, reading, changing and deleting drafts have tools of their own in the Drafts group, and sendEmail with a draft id sends one.

sendEmail with translateTo sends immediately and nobody reads the translation first. Call previewTranslation, show the person you are working for what it says, then pass the subject and body they approved back to sendEmail with translateTo LEFT OUT. Passing it again translates a second time and the wording moves.

translateTo takes a code (de), an English name ("German") or the language’s own name ("Deutsch"). One that cannot be placed refuses the call rather than sending the message untranslated. A message going out in a language its sender did not choose is the failure this refusal exists to prevent.

Translating costs three model calls (the body, the subject, and one to work out what you wrote in) whether you preview or send, so preview once rather than per revision. listTranslationLanguages costs nothing; it is a table, not a model call.

Neither tool proofreads and neither answers the message. Translation is all they do.

Reference

composeEmail

Scopesdrafts:writeThe app's assistant runs it without askingToolkitcore

Write the body of an email with AI from prompt, an instruction or a few rough notes, in the style of the mail this workspace has sent. Give threadId to write a reply: the messages of that thread are read as context. Give draft, the body written so far, to have prompt change it instead, withSubject true to get a subject too, and send, the send options as they stand (even empty), to let prompt change the recipients, the send time, tracking, the signature or the language; times are read in timeZone, or the time zone of the account. Give from, the address it goes out as, and send.fromOptions to let prompt move it to another of those addresses, and send.encrypt when every recipient can receive encrypted mail, to let prompt turn end-to-end encryption on or off. templates true lets prompt switch the email to one of the workspace's published templates, and files true lets it attach files the workspace holds. Returns the text first, then any subject, send changes, template and files to attach, in the shape sendEmail takes; it saves no draft and sends nothing, and it spends one AI action.

Inputs

promptstringRequired
emailSubjectstring
fromstring

The address it goes out as, so it is written as that address.

1 to 320 characters
templatestring

The id of the template the email uses now, so prompt leaves its body alone.

1 to 128 characters
templatesboolean

Let prompt switch the email to one of the workspace's published templates.

filesboolean

Let prompt attach files the workspace holds, found by their name.

withSubjectboolean
draftstring
Up to 20000 characters
tostring[]
ccstring[]
bccstring[]
sendobject
scheduledAtstring

When it is set to send, as an ISO-8601 time, or null when it sends right away.

Can be nullUp to 64 characters
trackingobject

Whether opens and clicks are tracked as it stands.

opensboolean
clicksboolean
signatureboolean

Whether the signature is added as it stands.

translateobject

The language it is translated into as it stands, or null when it is not.

Can be null
tostringRequired

A language code such as de, or a language name.

2 to 60 characters
fromOptionsstring[]

The addresses it may go out as. prompt can then move it to one of them, and the answer names it in send.from.

Up to 100 items
encryptboolean

Whether it is encrypted end to end as it stands. Give it only when every recipient can receive encrypted mail, so prompt can turn encryption on or off.

timeZonestring

The IANA time zone to read times in, such as Europe/Berlin. Without it, the time zone in the account settings.

1 to 64 characters
threadIdstring
threadMessagesobject[]
fromstringRequired
tostring[]Required
ccstring[]
subjectstringRequired
bodystringRequired

Also available in

API
POST /emails/compose
TypeScript
nextmail.emails.compose()
Python
emails.compose()
Ruby
emails.compose
PHP
emails->compose
Go
Emails.Compose
Java
emails().compose
C#
Emails.ComposeAsync

sendEmail

Scopesemails:sendThe app's assistant always asks firstToolkitcore

Send a new email. To answer an email, use replyToEmail instead: it works out the recipients, the subject, the threading and the quoted history from the message being answered. from is the address it goes out as, and you must name it: there is no default sender, so a send with from left out is refused rather than given an address you did not choose. The one exception is a draftId with from left out, which keeps the address that draft was written as, and is refused when the draft holds none. A draftId of a saved forward sends that forward: the forwarded email and its attachments go below your message, so the message holds only the words the user adds and never a copy of the original. What you may choose: as the owner, or with a role that reaches every address, any address on a verified domain this workspace owns; otherwise only the addresses you were given to send as. whoAmI says which applies, and listWorkspaceMembers names the addresses and whole domains each person reaches. Set translateTo to write it in the recipient's language: the subject and the body are translated before it goes and what you wrote is kept below the translation, unless includeOriginal is false. NOBODY SEES THAT TRANSLATION FIRST. This sends immediately, so call previewTranslation and show your user the result if they should read it before it leaves. A language this server cannot place is refused rather than sent untranslated. Translating costs three model calls: the body, the subject and one to work out what you wrote in. It translates only. It does not proofread the message and it never answers it. attachments takes file ids from uploadFile or listFiles, replyTo sets where answers go, signature false leaves the address's signature off, signatureId picks one of its signatures instead of the default, and scheduledAt sends it later instead of now.

Inputs

toobject[]Required
emailstringRequired
namestring
subjectstringRequired
messagestringRequired
ccobject[]
emailstringRequired
namestring
bccobject[]
emailstringRequired
namestring
fromstring
threadIdstring
draftIdstring
translateTostring
includeOriginalboolean
Defaulttrue
replyToobject

Where answers go when it should not be the from address: an email, with a name if you have one.

emailstringRequired
namestring
attachmentsstring[]

File ids to attach, from uploadFile or listFiles. Each goes out attached, and a large one as a download link when the address has a files domain. Leave it out when nothing is attached.

Up to 20 items
signatureboolean

The from address's signature is added below the message, as in the app. false leaves it off.

signatureIdstring

Which of the from address's signatures to add, by the id listSignatures reports. Left out, new mail carries the address's default and a reply its default for replies.

1 to 64 characters
attachmentDeliverystring

How the files go out: mime attaches them, link sends download links, and auto, the default, links large files only when the address has a files domain.

One of"mime""link""auto"
scheduledAtstring

An ISO 8601 time, such as 2030-01-15T09:00:00Z, up to a year ahead, to send it then rather than now. It waits in Scheduled until that time, and cancelEmail or rescheduleEmail change it before then.

Up to 64 characters
followUpAtstring

An ISO 8601 time, such as 2030-01-18T09:00:00Z, to be reminded if nobody replies by then. It has to be after the message goes out and at most a year ahead. If no real reply arrives, the thread returns to the top of the inbox, unread, with a push. listFollowUps lists the reminders and cancelFollowUp cancels one.

Formatdate-time
trackOpensboolean

true adds an open pixel to this message and false leaves it out. Left out, the setting of the address it is sent from decides, and that is off unless the address turned it on. Set it only when the user asks to track or not to track.

trackClicksboolean

true sends the links in this message through the tracking domain to count clicks and false leaves every link as written. Left out, the setting of the address it is sent from decides, and that is off unless the address turned it on. A link whose text is itself an address is never rewritten.

Also available in

API
POST /emails
TypeScript
nextmail.emails.send()
Python
emails.send()
Ruby
emails.send
PHP
emails->send
Go
Emails.Send
Java
emails().send
C#
Emails.SendAsync

previewTranslation

Scopesdrafts:writeThe app's assistant runs it without askingToolkittranslate

Answers "what would this actually say in their language, before I send it". Returns the translated subject and the exact body sendEmail would put on the wire, so the person you are working for can read it, and change it, first. Nothing is sent and nothing is stored. To send what they approved, pass the subject and body straight back to sendEmail with translateTo LEFT OUT. Their edits included, that is then word for word what leaves; passing translateTo again would translate a second time and the wording would move. It translates and nothing else: it does not proofread, it does not improve the writing, and it never answers the message. Costs three model calls, the same as sending with translateTo, so preview once rather than per revision.

Inputs

messagestringRequired
Not empty
subjectstring
translateTostringRequired
includeOriginalboolean
Defaulttrue

Also available in

API
POST /emails/translate
TypeScript
nextmail.emails.translate()
Python
emails.translate()
Ruby
emails.translate
PHP
emails->translate
Go
Emails.Translate
Java
emails().translate
C#
Emails.TranslateAsync

listTranslationLanguages

No scopeThe app's assistant runs it without askingToolkittranslate

Every language translateTo accepts, so you never have to guess a code. Pass search to filter by a fragment of a code, an English name or the language's own name. translateTo takes any of those three forms, so this is a way to check yourself rather than a step you must take first. Costs nothing. It is a table, not a model call.

Inputs

searchstring

replyToEmail

Scopesemails:sendthreads:readThe app's assistant always asks firstToolkitcore

Reply to an email inside its conversation. Use this, never sendEmail, whenever you are asked to reply to, answer or respond to an email. You give the thread, the words to add and whether it is reply or reply all; the server works out the rest from the message being answered, the same way the mail client does: who it goes to, the Re: subject, the In-Reply-To and References headers that keep it in the thread, the quoted history below your text, and the address it goes out from, which is the address of this workspace that received the message. There is no default sender, so a message none of your addresses received is refused unless you name from. Reply (the default) goes to the sender, or to their Reply-To, even when that is a colleague writing from another address of this workspace. For a message sent from here that no other address of this workspace received, it goes to the people it was sent to. Reply all also sends to everyone else on its To and Cc. Your other addresses are always left out and nobody on its Bcc is ever included. It answers the latest message of the thread unless you pass messageId. The message is plain text and is sent exactly as written. When the user handed you a saved draft of this reply, pass its draftId so that draft is deleted once the reply is sent. This sends the reply; it does not save a draft.

Inputs

threadIdstringRequired

The thread to answer: an id from inboxRag, listThreads or getThread, or the thread that is open.

Not empty
messageIdstring

Leave it out to answer the latest message of the thread, which is right unless the user named an earlier one. To answer an earlier message, pass its id only when a tool listed message ids for this thread, or its Message-ID header when the user gave you one. Never guess: an id this thread does not hold is refused.

replyAllboolean

false, the default, answers only the person the message came from (or its Reply-To), even a colleague writing from another address of this workspace. For a message sent from here that no other address of this workspace received, it goes to the people it was sent to. true also sends to everyone else on its To and Cc, never to your own addresses. Set true only when the user says reply all, reply to everyone, or asks to keep the others on it.

Defaultfalse
messagestringRequired

Only what you are adding: the body of the reply in plain text, with a blank line between paragraphs. It is sent exactly as written, so HTML tags arrive as text. No subject line, no quoted email and no signature: the quote of the message being answered and the signature are added for you.

Not empty
fromstring

Leave it out. The reply goes out from the address of this workspace that received the message. Set it only when the user asks to answer from a different address of theirs.

addCcstring[]

Extra people to copy, and only when the user names them.

Up to 50 items
addBccstring[]

People to blind copy, and only when the user names them. Nobody on the Bcc of the message being answered is ever included.

Up to 50 items
draftIdstring

The draftId of the saved draft of this reply, when the user wrote one and handed it to you. Once the reply is sent that draft is deleted, so no stale copy stays in drafts. A draft of any other thread is left alone.

followUpAtstring

An ISO 8601 time, such as 2030-01-18T09:00:00Z, to be reminded if nobody replies by then. It has to be after the message goes out and at most a year ahead. If no real reply arrives, the thread returns to the top of the inbox, unread, with a push. listFollowUps lists the reminders and cancelFollowUp cancels one.

Formatdate-time
trackOpensboolean

true adds an open pixel to this message and false leaves it out. Left out, the setting of the address it is sent from decides, and that is off unless the address turned it on. Set it only when the user asks to track or not to track.

trackClicksboolean

true sends the links in this message through the tracking domain to count clicks and false leaves every link as written. Left out, the setting of the address it is sent from decides, and that is off unless the address turned it on. A link whose text is itself an address is never rewritten.

attachmentsstring[]

File ids to attach, from uploadFile or listFiles. Each goes out attached, and a large one as a download link when the address has a files domain. Leave it out when nothing is attached.

Up to 20 items

Also available in

API
POST /emails
TypeScript
nextmail.emails.send()
Python
emails.send()
Ruby
emails.send
PHP
emails->send
Go
Emails.Send
Java
emails().send
C#
Emails.SendAsync

checkEmail

Scopesemails:sendThe app's assistant runs it without askingToolkitcore

Scores a message the way a receiving mailbox would, before it is sent: a spam score, a phishing score and an AI-writing score, each 0 to 100, with what raised each one. Call it on a draft before sendEmail or replyToEmail when the user wants it to land well, then fix what it names. Nothing is sent or stored, it costs nothing and it never calls a model. A low score is a good sign, not a delivery guarantee.

Inputs

subjectstring
Up to 998 charactersDefault""
bodystringRequired

The body, as HTML or plain text.

Up to 200000 characters
fromstring

The address it will be sent from.

fromNamestring

The name it will be sent under, which the phishing check reads.

Up to 320 characters
replyTostring

The Reply-To address, when answers should go somewhere other than from. The phishing check reads it.

Up to 320 characters
isReplyboolean

True when it answers an existing thread.

attachmentNamesstring[]

The names of the files it will carry, which the phishing check reads.

Up to 100 items

Also available in

API
POST /emails/check
TypeScript
nextmail.emails.check()
Python
emails.check()
Ruby
emails.check
PHP
emails->check
Go
Emails.Check
Java
emails().check
C#
Emails.CheckAsync

rewriteEmail

Scopesdrafts:writeThe app's assistant runs it without askingToolkitdrafts

Rewrite a subject or the body of an email and get up to five different versions, as the rewrite menu of the composer does, in the style of the mail this workspace has sent. action is shorten, lengthen, rephrase, formal, casual or custom, and custom needs instruction to say what to change. target is body (the default) or subject. Give threadId when the text is a reply, so the rewrite fits the conversation. Nothing is saved, and it spends one AI action.

Inputs

textstringRequired
1 to 100000 characters
actionstringRequired
One of"shorten""lengthen""rephrase""formal""casual""custom"
targetstring
One of"subject""body"
instructionstring
Up to 500 characters
countinteger
At least 1At most 5
threadIdstring

Also available in

API
POST /emails/rewrite
TypeScript
nextmail.emails.rewrite()
Python
emails.rewrite()
Ruby
emails.rewrite
PHP
emails->rewrite
Go
Emails.Rewrite
Java
emails().rewrite
C#
Emails.RewriteAsync

suggestSubject

Scopesdrafts:writeThe app's assistant runs it without askingToolkitdrafts

Suggest a short subject line for the body of an email, under 100 characters, in the style of the mail this workspace has sent. Nothing is saved, and it spends one AI action.

Inputs

messagestringRequired
1 to 100000 characters

Also available in

API
POST /emails/subject
TypeScript
nextmail.emails.suggestSubject()
Python
emails.suggest_subject()
Ruby
emails.suggest_subject
PHP
emails->suggestSubject
Go
Emails.SuggestSubject
Java
emails().suggestSubject
C#
Emails.SuggestSubjectAsync

getReplySuggestions

Scopesthreads:readThe app's assistant runs it without askingToolkitdrafts

Up to 3 short replies to the latest message of an email thread, the ones the reading pane offers under it, each with a label of a few words and the reply itself, written in the language of that message and in the voice of this workspace. They are kept until another message arrives, so asking again is free. Start a reply from one with replyToEmail, as it is or adapted. A thread whose latest message needs no reply, because your own reply came last or it is a newsletter, an automated notice, spam or an encrypted message, has none, and so does every thread when the workspace turned replySuggestions off in its settings.

Inputs

threadIdstringRequired
Not empty

Also available in

API
GET /threads/{id}/reply-suggestions
TypeScript
nextmail.threads.replySuggestions()
Python
threads.reply_suggestions()
Ruby
threads.reply_suggestions
PHP
threads->replySuggestions
Go
Threads.ReplySuggestions
Java
threads().replySuggestions
C#
Threads.ReplySuggestionsAsync

readVerificationCode

No scopeThe app's assistant runs it without askingToolkitworkspace

Find the sign-in or verification code in a message you pass in, with the reader that puts a code at the top of a message in Nextmail. Send the whole MIME source as raw, or the subject with html or text. It answers only when it is sure: exactly one code worded as one, so two different codes, or a number that could be an order, a booking or a promotion, give no code. It reads only what you send and cannot tell whether the sender is genuine. For mail already in the mailbox, getThread prints the code itself.

Inputs

rawstring

The whole message as MIME source. Wins over the other fields.

Up to 5000000 characters
subjectstring

Subject line.

Up to 998 characters
htmlstring

HTML body.

Up to 1000000 characters
textstring

Plain text body.

Up to 1000000 characters