You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add three new MCP tools for mailbox/folder management:
- list_mailboxes: List all available mailboxes/folders
- create_mailbox: Create a new mailbox/folder
- move_emails: Move emails between mailboxes
Implementation details:
- Added abstract methods to EmailHandler interface
- Implemented methods in EmailClient and ClassicEmailHandler
- Uses COPY + DELETE + EXPUNGE for move (IMAP compatibility)
- Proper mailbox name quoting via _quote_mailbox() for RFC 3501
@mcp.tool(description="List all available mailboxes/folders for an email account.")
225
+
asyncdeflist_mailboxes(
226
+
account_name: Annotated[str, Field(description="The name of the email account.")],
227
+
) ->list[str]:
228
+
handler=dispatch_handler(account_name)
229
+
returnawaithandler.list_mailboxes()
230
+
231
+
232
+
@mcp.tool(
233
+
description="Move one or more emails to another mailbox/folder. Use list_emails_metadata first to get email_ids and list_mailboxes to see available folders."
234
+
)
235
+
asyncdefmove_emails(
236
+
account_name: Annotated[str, Field(description="The name of the email account.")],
237
+
email_ids: Annotated[
238
+
list[str],
239
+
Field(description="List of email_id to move (obtained from list_emails_metadata)."),
240
+
],
241
+
target_mailbox: Annotated[str, Field(description="The target mailbox/folder to move emails to.")],
0 commit comments