Skip to main content
Glama
sugar-crash-studios

Proton MCP Server

Delete Email

proton_delete_email
DestructiveIdempotent

Delete Proton Mail emails by moving them to the Trash folder using folder names and email UIDs.

Instructions

Delete an email by moving it to the Trash folder. Use the folder name and email UID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoINBOX
uidYes

Implementation Reference

  • The handler for the proton_delete_email tool which calls the deleteMessage service.
    async (params: z.infer<typeof DeleteEmailSchema>) => {
      try {
        await deleteMessage(params.folder, params.uid);
    
        return {
          content: [
            {
              type: 'text',
              text: `Email UID ${params.uid} deleted successfully (moved to Trash)`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error deleting email: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • The underlying service implementation that performs the actual email deletion by moving it to the 'Trash' folder via IMAP.
    export async function deleteMessage(folder: string, uid: number): Promise<void> {
      const client = await getImapClient();
      try {
        const lock = await client.getMailboxLock(folder);
        try {
          await client.mailboxOpen(folder);
          const result = await client.messageMove(String(uid), 'Trash', { uid: true });
          if (!result) {
            throw new Error(`Message UID ${uid} not found in "${folder}"`);
          }
        } finally {
          lock.release();
        }
      } finally {
        await client.logout();
      }
    }
  • Registration of the proton_delete_email tool in the MCP server.
    export function registerDeleteEmailTool(server: McpServer) {
      server.registerTool(
        'proton_delete_email',
        {
          title: 'Delete Email',
          description: 'Delete an email by moving it to the Trash folder. Use the folder name and email UID.',
          inputSchema: DeleteEmailSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: true,
            idempotentHint: true,
            openWorldHint: false,
          },
        },
        async (params: z.infer<typeof DeleteEmailSchema>) => {
          try {
            await deleteMessage(params.folder, params.uid);
    
            return {
              content: [
                {
                  type: 'text',
                  text: `Email UID ${params.uid} deleted successfully (moved to Trash)`,
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error deleting email: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
            };
          }
        }
      );
    }
Behavior4/5

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

Annotations cover key traits (destructiveHint: true, idempotentHint: true, readOnlyHint: false), but the description adds valuable context by specifying that deletion moves the email to the Trash folder, clarifying the actual behavior beyond just 'delete.' It does not contradict annotations, as 'delete' aligns with destructiveHint: true.

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 two concise sentences with zero waste: the first states the purpose and method, the second specifies parameter usage. It is front-loaded and appropriately sized for the tool's complexity.

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 destructive nature (annotations indicate destructiveHint: true) and no output schema, the description adequately covers the basic operation but lacks details on outcomes (e.g., confirmation of deletion, error handling) and full parameter context. It is minimally viable but has 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.

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds some meaning by mentioning 'folder name and email UID,' but it does not detail semantics (e.g., what UID represents, default folder behavior). It partially compensates for the coverage gap but leaves parameters under-specified.

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 ('Delete an email by moving it to the Trash folder') and identifies the resource ('email'), distinguishing it from siblings like proton_move_email (which moves emails elsewhere) and proton_list_emails (which only reads). The verb 'delete' is precise and not tautological with the name/title.

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 'Use the folder name and email UID,' but it does not explicitly state when to use this tool versus alternatives (e.g., proton_move_email for moving to other folders, proton_list_emails for reading). It provides basic context but lacks explicit guidance on exclusions or prerequisites.

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