Skip to main content
Glama
sugar-crash-studios

Proton MCP Server

Reply to Email

proton_reply_email

Reply to emails in Proton Mail with proper threading headers. Set up replies to all recipients or just the sender using the Proton MCP Server.

Instructions

Send a reply to an existing email. Properly sets In-Reply-To and References headers for threading. Can reply to all or just the sender.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoINBOX
uidYes
bodyYes
reply_allNo

Implementation Reference

  • The `registerReplyEmailTool` function registers the `proton_reply_email` tool and contains the main logic handler which fetches the original email, determines recipients based on the `reply_all` parameter, and sends the reply using the `sendMail` service.
    export function registerReplyEmailTool(server: McpServer) {
      server.registerTool(
        'proton_reply_email',
        {
          title: 'Reply to Email',
          description: 'Send a reply to an existing email. Properly sets In-Reply-To and References headers for threading. Can reply to all or just the sender.',
          inputSchema: ReplyEmailSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: false,
          },
        },
        async (params: z.infer<typeof ReplyEmailSchema>) => {
          try {
            // Fetch the original message to get Message-ID and thread info
            const original = await fetchMessage(params.folder, params.uid);
    
            // Build recipient list
            let replyTo: string[] = [];
    
            if (params.reply_all) {
              // Reply to all: sender + cc recipients (exclude self)
              if (original.from.email && original.from.email !== PROTON_USER) {
                replyTo.push(original.from.email);
              }
    
              if (original.cc && original.cc.length > 0) {
                for (const cc of original.cc) {
                  if (cc.email && cc.email !== PROTON_USER) {
                    replyTo.push(cc.email);
                  }
                }
              }
            } else {
              // Reply to just the sender
              if (original.from.email) {
                replyTo.push(original.from.email);
              }
            }
    
            if (replyTo.length === 0) {
              return {
                content: [
                  {
                    type: 'text',
                    text: 'Error: No valid recipients found for reply.',
                  },
                ],
              };
            }
    
            // Send reply with threading headers
            const messageId = await sendMail({
              from: PROTON_USER,
              to: replyTo,
              subject: original.subject.startsWith('Re: ')
                ? original.subject
                : `Re: ${original.subject}`,
              text: params.body,
              inReplyTo: original.messageId,
              references: original.references,
            });
    
            return {
              content: [
                {
                  type: 'text',
                  text: `Reply sent successfully!\nMessage ID: ${messageId}\nTo: ${replyTo.join(', ')}\nOriginal Subject: ${original.subject}`,
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error sending reply: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
            };
          }
        }
      );
    }
  • The `ReplyEmailSchema` Zod object defines the expected input parameters for the `proton_reply_email` tool, including `folder`, `uid`, `body`, and `reply_all`.
    export const ReplyEmailSchema = z.object({
      folder: z.string().default('INBOX'),
      uid: z.number().int().positive(),
      body: z.string(),
      reply_all: z.boolean().default(false),
    });
Behavior3/5

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

Annotations indicate this is a non-readOnly, non-destructive, non-idempotent, non-openWorld operation, covering basic safety. The description adds value by specifying threading behavior ('Properly sets In-Reply-To and References headers') and reply options, but it lacks details on permissions, error handling, or rate limits. No contradiction with annotations exists.

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 sentences with zero waste: the first states the core purpose and technical detail, and the second clarifies usage options. It is front-loaded and efficiently structured, making it easy to parse.

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 no output schema and annotations covering basic traits, the description is moderately complete. It explains the tool's action and threading but lacks details on return values, error cases, or dependencies like email access permissions. For a mutation tool with 4 parameters, more context would improve completeness.

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 description must compensate. It mentions 'reply to all or just the sender,' which relates to the 'reply_all' parameter, but does not explain other parameters like 'folder' or 'uid.' The description adds some meaning but does not fully cover the four parameters, resulting in a baseline score.

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 ('Send a reply') and resource ('to an existing email'), distinguishing it from siblings like proton_send_email (new email) and proton_read_email (read-only). It includes technical details about threading headers, which adds precision.

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

Usage Guidelines4/5

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

The description provides clear context for usage ('reply to an existing email') and distinguishes between 'reply to all or just the sender,' but it does not explicitly state when to use this tool versus alternatives like proton_send_email for new emails or mention prerequisites such as needing a valid UID. This omission prevents a perfect score.

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