Skip to main content
Glama
beylessai

Hiworks Mail MCP

send_email

Send emails through Hiworks Mail MCP server with support for text, HTML content, attachments, CC, and BCC recipients.

Instructions

하이웍스 이메일을 전송합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameNo
passwordNo
toYes
subjectYes
textNo
htmlNo
ccNo
bccNo
attachmentsNo

Implementation Reference

  • The main execution logic for the send_email tool. Creates an SMTP transporter using the provided credentials and sends the email with nodemailer, returning success or error response.
      async ({ username, password, to, subject, text, html, cc, bcc, attachments }) => {
        try {
          log('Creating SMTP transporter...');
          const transporter = await createSMTPTransporter(username, password);
    
          const mailOptions = {
            from: username,
            to,
            subject,
            text,
            html,
            cc,
            bcc,
            attachments
          };
    
          log('Sending email...');
          const info = await transporter.sendMail(mailOptions);
          log('Email sent successfully:', info.messageId);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  success: true,
                  messageId: info.messageId
                } as SendEmailResponse)
              }
            ]
          };
        } catch (error: any) {
          log('Error sending email:', error);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  success: false,
                  error: error.message
                } as SendEmailResponse)
              }
            ]
          };
        }
      }
    );
    
    // 메인 함수
    async function main() {
  • src/index.ts:307-373 (registration)
    Registration of the send_email tool on the MCP server, specifying name, description, Zod input schema, and handler function.
    server.tool(
      'send_email',
      '하이웍스 이메일을 전송합니다.',
      {
        ...emailSchema,
        to: z.string(),
        subject: z.string(),
        text: z.string().optional(),
        html: z.string().optional(),
        cc: z.array(z.string()).optional(),
        bcc: z.array(z.string()).optional(),
        attachments: z.array(z.object({
          filename: z.string(),
          content: z.union([z.string(), z.instanceof(Buffer)])
        })).optional()
      },
      async ({ username, password, to, subject, text, html, cc, bcc, attachments }) => {
        try {
          log('Creating SMTP transporter...');
          const transporter = await createSMTPTransporter(username, password);
    
          const mailOptions = {
            from: username,
            to,
            subject,
            text,
            html,
            cc,
            bcc,
            attachments
          };
    
          log('Sending email...');
          const info = await transporter.sendMail(mailOptions);
          log('Email sent successfully:', info.messageId);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  success: true,
                  messageId: info.messageId
                } as SendEmailResponse)
              }
            ]
          };
        } catch (error: any) {
          log('Error sending email:', error);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  success: false,
                  error: error.message
                } as SendEmailResponse)
              }
            ]
          };
        }
      }
    );
    
    // 메인 함수
    async function main() {
      if (process.env.NODE_ENV === 'development') {
  • TypeScript interfaces defining the input (SendEmailParams) and output (SendEmailResponse) types for the send_email tool, imported and used in index.ts.
    export interface SendEmailParams {
      username?: string;
      password?: string;
      to: string;
      subject: string;
      text?: string;
      html?: string;
      cc?: string[];
      bcc?: string[];
      attachments?: Array<{
        filename: string;
        content: string | Buffer;
      }>;
    }
    
    export interface SendEmailResponse {
      success: boolean;
      messageId?: string;
      error?: string;
    } 
  • Helper function to create a nodemailer SMTP transporter configured for Hiworks SMTP server using the provided username and password.
    async function createSMTPTransporter(username: string, password: string) {
      return nodemailer.createTransport({
        host: config.smtp.host,
        port: config.smtp.port,
        secure: config.smtp.secure,
        auth: {
          user: username,
          pass: password
        }
      });
    }
Behavior1/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers none. It doesn't mention authentication requirements (despite username/password parameters), rate limits, error conditions, whether the operation is idempotent, or what happens on success/failure. For a mutation tool with 9 parameters, this lack of behavioral context is critically inadequate.

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 extremely concise - a single Korean sentence. While this is efficient, it's arguably under-specified rather than appropriately concise given the tool's complexity. However, it does front-load the core purpose without unnecessary elaboration, earning points for brevity.

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

Completeness1/5

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

For a mutation tool with 9 parameters (including complex nested objects for attachments), no annotations, 0% schema description coverage, and no output schema, the description is completely inadequate. It provides no information about authentication, parameter usage, return values, error handling, or behavioral characteristics that an agent needs to use this tool effectively.

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 none of the 9 parameters have descriptions in the schema. The tool description provides no information about any parameters, their purposes, formats, or relationships. This leaves critical parameters like 'attachments' (with nested objects) completely undocumented, failing to compensate for the schema's deficiencies.

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

Purpose2/5

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

The description '하이웍스 이메일을 전송합니다' (Sends Hiworks email) states the basic action but is tautological with the tool name 'send_email'. It doesn't specify what distinguishes this email sending tool from potential alternatives or clarify the scope beyond the obvious verb+resource pairing. While it identifies the service (Hiworks), it lacks specificity about capabilities or constraints.

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

Usage Guidelines1/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 the sibling tools (read_email, read_username, search_email). The description doesn't mention prerequisites, appropriate contexts, or exclusions. An agent would have to infer usage from the tool name alone without any contextual direction.

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/beylessai/hiworks-mcp'

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