Skip to main content
Glama
sugar-crash-studios

Proton MCP Server

Move Email

proton_move_email
Idempotent

Move emails between folders in Proton Mail by specifying source folder, email UID, and destination folder to organize your inbox.

Instructions

Move an email from one folder to another. Specify source folder, email UID, and destination folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderYes
uidYes
destinationYes

Implementation Reference

  • Handler for the 'proton_move_email' tool, using moveMessage from imap.ts.
    async (params: z.infer<typeof MoveEmailSchema>) => {
      try {
        await moveMessage(params.folder, params.uid, params.destination);
    
        return {
          content: [
            {
              type: 'text',
              text: `Email UID ${params.uid} moved successfully from "${params.folder}" to "${params.destination}"`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error moving email: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Input validation schema for 'proton_move_email'.
    export const MoveEmailSchema = z.object({
      folder: z.string(),
      uid: z.number().int().positive(),
      destination: z.string(),
    });
  • Registration of the 'proton_move_email' tool in the MCP server.
    server.registerTool(
      'proton_move_email',
      {
        title: 'Move Email',
        description: 'Move an email from one folder to another. Specify source folder, email UID, and destination folder.',
        inputSchema: MoveEmailSchema,
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async (params: z.infer<typeof MoveEmailSchema>) => {
        try {
          await moveMessage(params.folder, params.uid, params.destination);
    
          return {
            content: [
              {
                type: 'text',
                text: `Email UID ${params.uid} moved successfully from "${params.folder}" to "${params.destination}"`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error moving email: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Actual IMAP implementation for moving an email.
    export async function moveMessage(
      sourceFolder: string,
      uid: number,
      destinationFolder: string
    ): Promise<void> {
      const client = await getImapClient();
      try {
        const lock = await client.getMailboxLock(sourceFolder);
        try {
          await client.mailboxOpen(sourceFolder);
          const result = await client.messageMove(String(uid), destinationFolder, { uid: true });
          if (!result) {
            throw new Error(`Message UID ${uid} not found in "${sourceFolder}"`);
          }
        } finally {
          lock.release();
        }
      } finally {
        await client.logout();
      }
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide key behavioral traits (non-readOnly, non-destructive, idempotent), and the description adds context by specifying the action of moving an email between folders. It does not contradict annotations, and while it doesn't detail side effects like rate limits or auth needs, it offers useful operational context beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and lists parameters without unnecessary words. Every part earns its place, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (mutation with idempotency), no output schema, and annotations covering safety, the description is adequate but lacks details on return values, error conditions, or folder validation. It meets minimum viability but has clear gaps in completeness for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining the semantics of all three parameters (source folder, email UID, destination folder), adding meaning beyond the bare schema. It clarifies what each parameter represents, though it doesn't specify formats or constraints like folder naming rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Move an email') and resources involved ('from one folder to another'), distinguishing it from siblings like delete, list, read, reply, search, and send operations. It precisely defines the tool's function without being vague or tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying the required parameters, but it does not explicitly state when to use this tool versus alternatives (e.g., when moving versus deleting or replying to an email). No exclusions or prerequisites are mentioned, leaving usage context somewhat implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/sugar-crash-studios/proton-mcp-server'

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