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.
createImportStart an import of old mail into one address from files, named with their sizes. The files are uploaded in parts over the REST API or with the CLI, then startImport reads them.
getImportUploadStateWhich parts of the files of an import have arrived, so an interrupted upload sends only what is missing.
startImportStart reading the uploaded files once every part has arrived.
deleteImportUploadDelete the uploaded files of an import. Mail it 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, source the ones from files, an IMAP mailbox or Microsoft, and status the ones the Migrations page groups as queued (uploading or queued), running, paused (parked or waiting for a password), done, failed or cancelled. search matches the address and the file names. A member sees the imports into the addresses they reach. listProviderImports lists the imports from sending providers. 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
sourcestring
One of"file""imap""microsoft"
statusstring
One of"queued""running""paused""done""failed""cancelled"
searchstring
Up to 320 characters
limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /importsGET /provider-imports
TypeScript
imports.list()imports.listAll()imports.iterate()providerImports.list()providerImports.listAll()providerImports.iterate()
Python
imports.list()imports.list_all()imports.iterate()provider_imports.list()provider_imports.list_all()provider_imports.iterate()
Ruby
imports.listimports.list_allimports.iterateprovider_imports.listprovider_imports.list_allprovider_imports.iterate
PHP
imports->listimports->listAllimports->iterateproviderImports->listproviderImports->listAllproviderImports->iterate
Go
Imports.ListImports.ListAllImports.IterateProviderImports.ListProviderImports.ListAllProviderImports.Iterate
Java
imports().listimports().listAllimports().iterateproviderImports().listproviderImports().listAllproviderImports().iterate
C#
Imports.ListAsyncImports.ListAllAsyncImports.IterateAsyncProviderImports.ListAsyncProviderImports.ListAllAsyncProviderImports.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
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
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
imports.cancel()
Python
imports.cancel()
Ruby
imports.cancel
PHP
imports->cancel
Go
Imports.Cancel
Java
imports().cancel
C#
Imports.CancelAsync

createImport

Scopesthreads:writeThe app's assistant asks first unless you asked for itToolkitworkspace

Start an import of old mail into one address from files: Google Takeout archives, .mbox, .eml, .zip or .tgz. It names the files and their sizes and answers with the import, waiting for them. The files themselves are too large for a tool call: they are uploaded in parts of 8 MB with PUT /imports/{id}/files/{file}/chunks/{chunk} on the REST API, or with the CLI, and then startImport reads them. Imported mail is quiet: no rules, forwards, notifications, summaries or webhooks run for it.

Inputs

addressIdstringRequired

The address the mail belongs to.

1 to 128 characters
filesobject[]Required
1 to 50 items
namestringRequired
1 to 255 characters
bytesintegerRequired
At least 1At most 107374182400
optionsobject
keepInboxboolean

Default true. Mail that was in the old inbox lands in Inbox with its unread state; false files everything under Archive.

includeSpamboolean

Default false.

includeTrashboolean

Default false.

Also available in

API
POST /imports
TypeScript
imports.create()imports.importFiles()
Python
imports.create()imports.import_files()
Ruby
imports.createimports.import_files
PHP
imports->createimports->importFiles
Go
Imports.CreateImports.ImportFiles
Java
imports().createimports().importFiles
C#
Imports.CreateAsyncImports.ImportFilesAsync

startImport

Scopesthreads:writeThe app's assistant asks first unless you asked for itToolkitworkspace

Start reading the uploaded files of an import, once every part of every file has arrived. It runs in the background; getImport follows it. A file still missing parts is refused with missing_chunks.

Inputs

idstringRequired
1 to 128 characters

Also available in

API
POST /imports/{id}/start
TypeScript
imports.start()
Python
imports.start()
Ruby
imports.start
PHP
imports->start
Go
Imports.Start
Java
imports().start
C#
Imports.StartAsync

deleteImportUpload

Scopesthreads:writeThe app's assistant always asks firstToolkitworkspace

Delete the uploaded files of an import. Mail it already imported stays in the mailbox. It is refused while the import is queued or running.

Inputs

idstringRequired
1 to 128 characters

Also available in

API
DELETE /imports/{id}/upload
TypeScript
imports.deleteUpload()
Python
imports.delete_upload()
Ruby
imports.delete_upload
PHP
imports->deleteUpload
Go
Imports.DeleteUpload
Java
imports().deleteUpload
C#
Imports.DeleteUploadAsync

listProviderImports

Scopessettings:readThe app's assistant runs it without askingToolkitworkspace

The imports from another email provider (Resend, SendGrid, Postmark, Mailgun or Mailchimp) into this workspace, newest first: which provider, what each one brings across and its status. source keeps the ones from one provider, and status the ones the Migrations page groups as queued, running, done (completed), failed or cancelled. An import from a provider never pauses, so paused matches none. search matches the provider and what each one brings across. Only the workspace owner reaches them. getProviderImport gives the full report of one. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

sourcestring
One of"resend""sendgrid""postmark""mailgun""mailchimp"
statusstring
One of"queued""running""paused""done""failed""cancelled"
searchstring
Up to 320 characters
limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /importsGET /provider-importsGET /provider-imports/{id}
TypeScript
imports.list()imports.listAll()imports.iterate()providerImports.list()providerImports.listAll()providerImports.iterate()providerImports.get()
Python
imports.list()imports.list_all()imports.iterate()provider_imports.list()provider_imports.list_all()provider_imports.iterate()provider_imports.get()
Ruby
imports.listimports.list_allimports.iterateprovider_imports.listprovider_imports.list_allprovider_imports.iterateprovider_imports.get
PHP
imports->listimports->listAllimports->iterateproviderImports->listproviderImports->listAllproviderImports->iterateproviderImports->get
Go
Imports.ListImports.ListAllImports.IterateProviderImports.ListProviderImports.ListAllProviderImports.IterateProviderImports.Get
Java
imports().listimports().listAllimports().iterateproviderImports().listproviderImports().listAllproviderImports().iterateproviderImports().get
C#
Imports.ListAsyncImports.ListAllAsyncImports.IterateAsyncProviderImports.ListAsyncProviderImports.ListAllAsyncProviderImports.IterateAsyncProviderImports.GetAsync

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
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
imports.discoverMailbox()
Python
imports.discover_mailbox()
Ruby
imports.discover_mailbox
PHP
imports->discoverMailbox
Go
Imports.DiscoverMailbox
Java
imports().discoverMailbox
C#
Imports.DiscoverMailboxAsync