Skip to main content
Glama
sugar-crash-studios

Proton MCP Server

Send Email

proton_send_email

Send emails using Proton Mail with support for plain text or HTML formatting, multiple recipients, and CC/BCC fields.

Instructions

Send a new email. Supports plain text and HTML formats. Recipients can be a single string or array of strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
ccNo
bccNo
subjectYes
bodyYes
htmlNo

Implementation Reference

  • The handler logic for the 'proton_send_email' tool, which validates input parameters and calls the 'sendMail' service to send an email via SMTP.
    async (params: z.infer<typeof SendEmailSchema>) => {
      try {
        // Ensure to, cc, bcc are arrays
        const toArray = Array.isArray(params.to) ? params.to : [params.to];
        const ccArray = params.cc ? (Array.isArray(params.cc) ? params.cc : [params.cc]) : undefined;
        const bccArray = params.bcc ? (Array.isArray(params.bcc) ? params.bcc : [params.bcc]) : undefined;
    
        const messageId = await sendMail({
          from: PROTON_USER,
          to: toArray,
          cc: ccArray,
          bcc: bccArray,
          subject: params.subject,
          text: !params.html ? params.body : undefined,
          html: params.html ? params.body : undefined,
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Email sent successfully!\nMessage ID: ${messageId}\nTo: ${toArray.join(', ')}\nSubject: ${params.subject}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error sending email: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Registration of the 'proton_send_email' tool in the MCP server.
    server.registerTool(
      'proton_send_email',
      {
        title: 'Send Email',
        description: 'Send a new email. Supports plain text and HTML formats. Recipients can be a single string or array of strings.',
        inputSchema: SendEmailSchema,
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
      async (params: z.infer<typeof SendEmailSchema>) => {
        try {
          // Ensure to, cc, bcc are arrays
          const toArray = Array.isArray(params.to) ? params.to : [params.to];
          const ccArray = params.cc ? (Array.isArray(params.cc) ? params.cc : [params.cc]) : undefined;
          const bccArray = params.bcc ? (Array.isArray(params.bcc) ? params.bcc : [params.bcc]) : undefined;
    
          const messageId = await sendMail({
            from: PROTON_USER,
            to: toArray,
            cc: ccArray,
            bcc: bccArray,
            subject: params.subject,
            text: !params.html ? params.body : undefined,
            html: params.html ? params.body : undefined,
          });
    
          return {
            content: [
              {
                type: 'text',
                text: `Email sent successfully!\nMessage ID: ${messageId}\nTo: ${toArray.join(', ')}\nSubject: ${params.subject}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error sending email: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Zod schema definition for 'proton_send_email' inputs.
    export const SendEmailSchema = z.object({
      to: z.union([z.string(), z.array(z.string())]),
      cc: z.union([z.string(), z.array(z.string())]).optional(),
      bcc: z.union([z.string(), z.array(z.string())]).optional(),
      subject: z.string(),
      body: z.string(),
      html: z.boolean().default(false),
    });
  • Service function that handles the actual SMTP email sending using nodemailer.
    export async function sendMail(options: MailOptions): Promise<string> {
      const transporter = getTransporter();
    
      const mailOptions = {
        from: options.from || PROTON_USER,
        to: options.to,
        cc: options.cc,
        bcc: options.bcc,
        subject: options.subject,
        text: options.text,
        html: options.html,
        headers: {} as Record<string, string>,
      };
    
      // Set threading headers if provided
      if (options.inReplyTo) {
        mailOptions.headers['In-Reply-To'] = options.inReplyTo;
      }
      if (options.references) {
        mailOptions.headers['References'] = options.references;
      }
    
      const result = await transporter.sendMail(mailOptions);
      return result.messageId || 'success';
    }
Behavior2/5

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

Annotations indicate this is a non-readOnly, non-destructive operation, but the description doesn't add meaningful behavioral context beyond that. It mentions format support (plain text/HTML) and recipient flexibility, but fails to disclose critical traits like rate limits, authentication requirements, error handling, or whether emails are sent immediately or queued. With annotations covering basic safety, the description adds minimal value.

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

Conciseness4/5

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

The description is brief and front-loaded, consisting of two efficient sentences that directly state the tool's function and key features. There's no unnecessary verbiage, though it could benefit from more structured information to improve clarity without sacrificing conciseness.

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

Completeness2/5

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

Given the complexity of a 6-parameter email-sending tool with no output schema and 0% schema coverage, the description is insufficient. It omits details on parameter usage, error conditions, response format, and integration with sibling tools. For a mutation tool with rich functionality, this leaves significant gaps in understanding how to effectively invoke it.

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

Parameters1/5

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

Schema description coverage is 0%, meaning parameters lack documentation in the schema. The description only vaguely mentions recipients ('single string or array of strings') and formats, but doesn't explain the purpose or semantics of key parameters like 'to', 'cc', 'bcc', 'subject', 'body', or 'html'. It fails to compensate for the schema gap, leaving parameters largely unexplained.

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

Purpose4/5

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

The description clearly states the verb ('Send') and resource ('email'), specifying it's for sending new emails with format support. It distinguishes from siblings like delete, list, move, read, reply, and search by focusing on creation rather than manipulation or retrieval, though it doesn't explicitly contrast with 'proton_reply_email' which also sends emails.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'proton_reply_email' for responding to existing emails or 'proton_list_emails' for checking sent items. The description lacks context about prerequisites, such as needing valid recipient addresses or authentication, and doesn't mention exclusions or typical use cases.

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