Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

move_email

Transfer emails between mailboxes to organize your inbox by moving selected messages to specified folders.

Instructions

Move emails to another mailbox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidsYesEmail UIDs
destinationYesDestination mailbox
mailboxNoSource mailbox (default: current)

Implementation Reference

  • The actual implementation of the move_email tool which interacts with the IMAP client.
    def move_email(
        self, uids: list[int], destination: str, mailbox: Optional[str] = None
    ) -> bool:
        """Move emails to another mailbox."""
        self._ensure_connected()
        if mailbox:
            self.select_mailbox(mailbox)
        self.client.move(uids, destination)
        return True
  • Tool registration and schema definition for move_email.
    make_tool(
        "move_email",
        "Move emails to another mailbox",
        {
            "uids": {
                "type": "array",
                "items": {"type": "number"},
                "description": "Email UIDs",
            },
            "destination": {"type": "string", "description": "Destination mailbox"},
            "mailbox": {"type": "string", "description": "Source mailbox (default: current)"},
        },
        ["uids", "destination"],
    ),
  • Tool dispatch logic that calls the move_email handler.
    elif name == "move_email":
        return imap_client.move_email(
            uids=args["uids"],
            destination=args["destination"],
            mailbox=args.get("mailbox"),
        )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Soundhannes/IMAP-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server