Skip to the documentation
MCP server

Imports

Old mail coming in, and moves from another provider.

Imports tools

ToolWhat it does
listImportsThe imports of old mail into the workspace, newest first, with their status and progress. addressId keeps the ones into one address.
getImportOne import by its id: its files, how far it has read and how many messages it imported.
listImportFailuresThe messages an import could not bring in, and why.
cancelImportStop an import that is still running. Mail it already imported stays. In the app’s chat it always asks first.
listProviderImportsThe imports from another email provider (Resend, SendGrid, Postmark, Mailgun or Mailchimp), newest first, with their provider and status.
getProviderImportOne import from another provider with its report: what came across, the domains to publish here and the API keys to replace.
cancelProviderImportStop an import from another provider that is still running. What it already brought across stays. In the app’s chat it always asks first.
discoverMailboxSettingsLook up how to reach an old mailbox from its address: the provider, the IMAP server and whether it takes an app password, a password or a Microsoft sign-in. Nothing is connected.

Imports of old mail need threads:read, and threads:write to cancel one. A client limited to some addresses sees only the imports into them.

Imports from another provider need settings:read, and settings:write to cancel one. Only the workspace owner reaches them.

No tool uploads mail or starts an import, because the files go up in parts and an import from another provider needs its API key. Start one on the Migrations page of the app, or with POST /imports and POST /provider-imports on the REST API.

discoverMailboxSettings needs threads:write and only looks a server up. Copying a live mailbox takes the password of the old mailbox, which never passes through a tool: the person enters it on the Migrations page, or a script sends it with POST /imports/mailbox.

Reference

listImports

Scopesthreads:readThe app's assistant runs it without askingToolkitworkspace

The imports of old mail into this workspace, newest first, as the Migrations page of the app lists them: the address each one fills, its status, how far it has read and how many messages it imported. addressId keeps the ones into one address. A member sees the imports into the addresses they reach. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

addressIdstring
1 to 128 characters
limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /imports
TypeScript
nextmail.imports.list()nextmail.imports.listAll()nextmail.imports.iterate()
Python
imports.list()imports.list_all()imports.iterate()
Ruby
imports.listimports.list_allimports.iterate
PHP
imports->listimports->listAllimports->iterate
Go
Imports.ListImports.ListAllImports.Iterate
Java
imports().listimports().listAllimports().iterate
C#
Imports.ListAsyncImports.ListAllAsyncImports.IterateAsync

getImport

Scopesthreads:readThe app's assistant runs it without askingToolkitworkspace

One import of old mail by its id: its status, the files it reads, how far it has read, and how many messages it imported, found already here, left out or could not import. listImportFailures says which messages did not import and why.

Inputs

idstringRequired
1 to 128 characters

Also available in

API
GET /imports/{id}
TypeScript
nextmail.imports.get()
Python
imports.get()
Ruby
imports.get
PHP
imports->get
Go
Imports.Get
Java
imports().get
C#
Imports.GetAsync

listImportFailures

Scopesthreads:readThe app's assistant runs it without askingToolkitworkspace

The messages an import could not bring in, in the order it met them, with the reason for each, as What was not imported on the Migrations page shows them. When more follow, the last line gives the after value to pass back for the next page.

Inputs

idstringRequired
1 to 128 characters
afterinteger
At least -1
limitinteger
At least 1At most 100

Also available in

API
GET /imports/{id}/failures
TypeScript
nextmail.imports.listFailures()
Python
imports.list_failures()
Ruby
imports.list_failures
PHP
imports->listFailures
Go
Imports.ListFailures
Java
imports().listFailures
C#
Imports.ListFailuresAsync

cancelImport

Scopesthreads:writeThe app's assistant always asks firstToolkitworkspace

Stop an import of old mail that is still uploading, waiting or running, as Cancel import on the Migrations page does. Mail it already imported stays in the mailbox. A chat always asks first.

Inputs

idstringRequired
1 to 128 characters

Also available in

API
POST /imports/{id}/cancel
TypeScript
nextmail.imports.cancel()
Python
imports.cancel()
Ruby
imports.cancel
PHP
imports->cancel
Go
Imports.Cancel
Java
imports().cancel
C#
Imports.CancelAsync

listProviderImports

Scopessettings:readThe app's assistant runs it without askingToolkitworkspace

getProviderImport

Scopessettings:readThe app's assistant runs it without askingToolkitworkspace

cancelProviderImport

Scopessettings:writeThe app's assistant always asks firstToolkitworkspace

Stop an import from another email provider that is still waiting or running. What it already brought across stays. Only the workspace owner can, and a chat always asks first.

Inputs

idstringRequired
1 to 128 characters

Also available in

API
POST /provider-imports/{id}/cancel
TypeScript
nextmail.providerImports.cancel()
Python
provider_imports.cancel()
Ruby
provider_imports.cancel
PHP
providerImports->cancel
Go
ProviderImports.Cancel
Java
providerImports().cancel
C#
ProviderImports.CancelAsync

discoverMailboxSettings

Scopesthreads:writeThe app's assistant runs it without askingToolkitworkspace

Look up how to reach an old mailbox at another provider, from its address alone, as the Mailbox tab of the Migrations page does before it asks for a password: which provider it is, the IMAP server, port and username to read it with, whether it takes an app password, the mailbox password or a Microsoft sign-in, and whether its contacts and calendars can come across too. Nothing is connected and no password is involved. Copying the mail itself takes the password of the old mailbox, which a tool call must never carry, so the person starts that in the app.

Inputs

emailstringRequired
3 to 320 characters

Also available in

API
GET /imports/mailbox-settings
TypeScript
nextmail.imports.discoverMailbox()
Python
imports.discover_mailbox()
Ruby
imports.discover_mailbox
PHP
imports->discoverMailbox
Go
Imports.DiscoverMailbox
Java
imports().discoverMailbox
C#
Imports.DiscoverMailboxAsync