Skip to main content
Glama
Racimy

iMail-mcp

send_email

Send emails through iCloud Mail to recipients with subject and text or HTML content. Use this tool to compose and deliver messages directly from your workflow.

Instructions

Send an email through iCloud Mail

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlNoHTML email body
subjectYesEmail subject
textNoPlain text email body
toYesRecipient email address(es)

Implementation Reference

  • Core handler function that executes the email sending logic using nodemailer Transporter via iCloud SMTP.
    async sendEmail(options: SendEmailOptions): Promise<{ messageId: string }> {
      const mailOptions: nodemailer.SendMailOptions = {
        from: this.config.email,
        to: options.to,
        subject: options.subject,
      };
    
      if (options.text) {
        mailOptions.text = options.text;
      }
    
      if (options.html) {
        mailOptions.html = options.html;
      }
    
      if (options.attachments) {
        mailOptions.attachments = options.attachments.map((att) => ({
          filename: att.filename,
          path: att.path,
          content: att.content,
          contentType: att.contentType,
        }));
      }
    
      const info = await this.transporter.sendMail(mailOptions);
      return { messageId: info.messageId };
    }
  • MCP server request handler that processes 'send_email' tool calls and delegates to iCloudMailClient.sendEmail.
    case 'send_email': {
      if (!mailClient) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          'iCloud Mail not configured. Please set ICLOUD_EMAIL and ICLOUD_APP_PASSWORD environment variables.'
        );
      }
    
      const result = await mailClient.sendEmail({
        to: args?.to as string | string[],
        subject: args?.subject as string,
        text: args?.text as string,
        html: args?.html as string,
      });
    
      return {
        content: [
          {
            type: 'text',
            text: `Email sent successfully. Message ID: ${result.messageId}`,
          },
        ],
      };
    }
  • src/index.ts:81-109 (registration)
    Registers the 'send_email' tool in the MCP ListTools response with name, description, and input schema.
    {
      name: 'send_email',
      description: 'Send an email through iCloud Mail',
      inputSchema: {
        type: 'object',
        properties: {
          to: {
            oneOf: [
              { type: 'string' },
              { type: 'array', items: { type: 'string' } },
            ],
            description: 'Recipient email address(es)',
          },
          subject: {
            type: 'string',
            description: 'Email subject',
          },
          text: {
            type: 'string',
            description: 'Plain text email body',
          },
          html: {
            type: 'string',
            description: 'HTML email body',
          },
        },
        required: ['to', 'subject'],
      },
    },
  • TypeScript interface defining the input parameters for the sendEmail function.
    export interface SendEmailOptions {
      to: string | string[];
      subject: string;
      text?: string;
      html?: string;
      attachments?: Array<{
        filename: string;
        path?: string;
        content?: Buffer;
        contentType?: string;
      }>;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('Send') but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or whether the email is sent immediately or queued. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy to parse quickly.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success/failure, return values, or behavioral constraints. For a tool that sends emails, more context is needed to use it effectively.

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 100%, so the schema already documents all parameters (to, subject, html, text) with clear descriptions. The description adds no additional parameter information beyond what's in the schema, meeting the baseline for high coverage but not enhancing understanding.

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 action ('Send') and resource ('email through iCloud Mail'), making the purpose immediately understandable. However, it doesn't distinguish this from potential sibling tools like 'move_messages' or 'set_flags' that might also involve email operations, so it lacks sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), exclusions, or compare it to sibling tools like 'create_mailbox' or 'delete_messages', leaving the agent with no context for tool selection.

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/Racimy/iMail-mcp'

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