Skip to main content
Glama
hongsw

Aligo SMS MCP Server

by hongsw

send-sms

Send SMS, LMS, or MMS messages via the Aligo API. Specify sender, recipient(s), message content, type, and optional image, title, or scheduling details for efficient communication.

Instructions

Send SMS messages through the Aligo API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationNoOptional formatted destination with names (01011112222|홍길동,01033334444|아무개)
image_pathNoOptional image file path for MMS
messageYesSMS message content
msg_typeNoMessage type: SMS, LMS, or MMS
receiverYesRecipient's phone number, or comma-separated list for multiple recipients
schedule_dateNoOptional schedule date (YYYYMMDD)
schedule_timeNoOptional schedule time (HHMM)
senderYesSender's phone number (registered with Aligo)
titleNoMessage title (required for LMS/MMS)

Implementation Reference

  • index.js:160-226 (registration)
    Registration of the 'send-sms' tool using server.tool, including description, schema, and handler reference
    server.tool(
      "send-sms",
      "Send SMS messages through the Aligo API",
      {
        sender: z.string().min(1).max(16).describe("Sender's phone number (registered with Aligo)"),
        receiver: z.string().min(1).describe("Recipient's phone number, or comma-separated list for multiple recipients"),
        message: z.string().min(1).max(2000).describe("SMS message content"),
        msg_type: z.enum(["SMS", "LMS", "MMS"]).optional().describe("Message type: SMS, LMS, or MMS"),
        title: z.string().max(44).optional().describe("Message title (required for LMS/MMS)"),
        schedule_date: z.string().regex(/^\d{8}$/).optional().describe("Optional schedule date (YYYYMMDD)"),
        schedule_time: z.string().regex(/^\d{4}$/).optional().describe("Optional schedule time (HHMM)"),
        destination: z.string().optional().describe("Optional formatted destination with names (01011112222|홍길동,01033334444|아무개)"),
        image_path: z.string().optional().describe("Optional image file path for MMS")
      },
      async ({ sender, receiver, message, msg_type, title, schedule_date, schedule_time, destination, image_path }) => {
        debug("send-sms 메서드 호출됨", { sender, receiver, message });
        
        try {
          // Check if LMS/MMS requires a title
          if ((msg_type === "LMS" || msg_type === "MMS") && !title) {
            return {
              content: [{ type: "text", text: "제목이 필요합니다: LMS와 MMS 메시지는 제목이 필수입니다." }],
              error: "제목 누락 (LMS/MMS)"
            };
          }
    
          const authData = {
            apiKey: config.ALIGO_API_KEY,
            userId: config.ALIGO_USER_ID,
            testMode: config.ALIGO_TEST_MODE === 'Y'
          };
          
          const params = {
            sender,
            receiver,
            message,
            msg_type: msg_type || "SMS",
            title,
            schedule_date,
            schedule_time,
            destination,
            image_path
          };
    
          debug("authData", authData);
          debug("params", params);
          
          // 직접 구현한 함수로 SMS 전송
          const result = await sendAligoSMS(params, authData);
          debug("API 응답:", result);
          
          // 응답 형식화
          return {
            content: [
              { type: "text", text: `메시지 전송 성공: ${result.msg_id ? '메시지 ID ' + result.msg_id : result.message || '전송 완료'}` }
            ],
            result: result
          };
        } catch (error) {
          console.error("Error sending SMS:", error);
          return {
            content: [{ type: "text", text: `메시지 전송 실패: ${error.message || "알 수 없는 오류"}` }],
            error: error.message || "알 수 없는 오류"
          };
        }
      }
    );
  • Handler function that performs input validation, retrieves auth config, calls sendAligoSMS helper, and formats success/error responses.
    async ({ sender, receiver, message, msg_type, title, schedule_date, schedule_time, destination, image_path }) => {
      debug("send-sms 메서드 호출됨", { sender, receiver, message });
      
      try {
        // Check if LMS/MMS requires a title
        if ((msg_type === "LMS" || msg_type === "MMS") && !title) {
          return {
            content: [{ type: "text", text: "제목이 필요합니다: LMS와 MMS 메시지는 제목이 필수입니다." }],
            error: "제목 누락 (LMS/MMS)"
          };
        }
    
        const authData = {
          apiKey: config.ALIGO_API_KEY,
          userId: config.ALIGO_USER_ID,
          testMode: config.ALIGO_TEST_MODE === 'Y'
        };
        
        const params = {
          sender,
          receiver,
          message,
          msg_type: msg_type || "SMS",
          title,
          schedule_date,
          schedule_time,
          destination,
          image_path
        };
    
        debug("authData", authData);
        debug("params", params);
        
        // 직접 구현한 함수로 SMS 전송
        const result = await sendAligoSMS(params, authData);
        debug("API 응답:", result);
        
        // 응답 형식화
        return {
          content: [
            { type: "text", text: `메시지 전송 성공: ${result.msg_id ? '메시지 ID ' + result.msg_id : result.message || '전송 완료'}` }
          ],
          result: result
        };
      } catch (error) {
        console.error("Error sending SMS:", error);
        return {
          content: [{ type: "text", text: `메시지 전송 실패: ${error.message || "알 수 없는 오류"}` }],
          error: error.message || "알 수 없는 오류"
        };
      }
    }
  • Input schema defined with Zod validators for all send-sms parameters including descriptions.
    {
      sender: z.string().min(1).max(16).describe("Sender's phone number (registered with Aligo)"),
      receiver: z.string().min(1).describe("Recipient's phone number, or comma-separated list for multiple recipients"),
      message: z.string().min(1).max(2000).describe("SMS message content"),
      msg_type: z.enum(["SMS", "LMS", "MMS"]).optional().describe("Message type: SMS, LMS, or MMS"),
      title: z.string().max(44).optional().describe("Message title (required for LMS/MMS)"),
      schedule_date: z.string().regex(/^\d{8}$/).optional().describe("Optional schedule date (YYYYMMDD)"),
      schedule_time: z.string().regex(/^\d{4}$/).optional().describe("Optional schedule time (HHMM)"),
      destination: z.string().optional().describe("Optional formatted destination with names (01011112222|홍길동,01033334444|아무개)"),
      image_path: z.string().optional().describe("Optional image file path for MMS")
    },
  • Primary helper function that implements the actual Aligo SMS API call using axios, supports MMS with image upload via FormData, handles errors.
    async function sendAligoSMS(params, authData) {
      try {
        const apiUrl = 'https://apis.aligo.in/send/';
        
        // 기본 POST 데이터 준비
        const postData = {
          key: authData.apiKey,
          user_id: authData.userId,
          sender: params.sender,
          receiver: params.receiver,
          msg: params.message,
          testmode_yn: authData.testMode ? 'Y' : 'N'
        };
        
        // 선택적 파라미터 추가
        if (params.msg_type === 'LMS' || params.msg_type === 'MMS') {
          postData.title = params.title;
        }
        
        if (params.destination) {
          postData.destination = params.destination;
        }
        
        if (params.schedule_date) {
          postData.rdate = params.schedule_date;
        }
        
        if (params.schedule_time) {
          postData.rtime = params.schedule_time;
        }
        
        // 이미지 첨부가 필요한 경우 (MMS)
        if (params.msg_type === 'MMS' && params.image_path) {
          if (!fs.existsSync(params.image_path)) {
            throw new Error(`이미지 파일을 찾을 수 없습니다: ${params.image_path}`);
          }
          
          // FormData 사용하여 multipart/form-data 요청 생성
          const form = new FormData();
          
          // 텍스트 필드 추가
          Object.keys(postData).forEach(key => {
            form.append(key, postData[key]);
          });
          
          // 이미지 파일 추가
          const fileStream = fs.createReadStream(params.image_path);
          const fileName = path.basename(params.image_path);
          form.append('image', fileStream, {
            filename: fileName,
            contentType: getMimeType(fileName)
          });
          
          // axios로 요청 전송
          const response = await axios.post(apiUrl, form, {
            headers: {
              ...form.getHeaders()
            },
            timeout: 30000 // 30초 타임아웃
          });
          
          debug('API 응답:', response.data);
          return response.data;
          
        } else {
          // 일반 텍스트 메시지 (MMS가 아니거나 이미지가 없는 경우)
          const response = await axios.post(apiUrl, postData, {
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded'
            },
            timeout: 30000 // 30초 타임아웃
          });
          
          debug('API 응답:', response.data);
          return response.data;
        }
      } catch (error) {
        debug('알리고 SMS 전송 오류:', error);
        if (error.response) {
          // 서버가 응답을 반환한 경우
          debug('응답 상태:', error.response.status);
          debug('응답 데이터:', error.response.data);
          throw new Error(`API 오류: ${error.response.status} - ${JSON.stringify(error.response.data)}`);
        } else if (error.request) {
          // 요청이 전송되었지만 응답을 받지 못한 경우
          throw new Error('API 서버로부터 응답을 받지 못했습니다.');
        } else {
          // 요청 설정 중 오류가 발생한 경우
          throw error;
        }
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It fails to mention critical aspects like whether this is a mutation (likely yes, as it sends messages), potential costs, rate limits, error handling, or response format, leaving significant gaps in understanding the tool's behavior.

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 wasted words. It's appropriately sized and front-loaded, clearly stating the core function without unnecessary elaboration.

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 tool's complexity (9 parameters, mutation operation) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral traits, usage context, or return values, making it inadequate for an agent to fully understand how to invoke and interpret results from this 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 100%, so the schema fully documents all 9 parameters. The description adds no additional parameter information beyond what's in the schema, such as explaining interactions between parameters (e.g., 'title' required for LMS/MMS) or usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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 SMS messages') and target ('through the Aligo API'), providing a specific verb+resource combination. However, it doesn't distinguish from siblings since there are none, and it could be more precise about the full capability (handling SMS, LMS, and MMS).

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, prerequisites, or constraints. The description lacks context about appropriate use cases, rate limits, or authentication requirements, offering no usage direction beyond the basic function.

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

Related 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/hongsw/aligo-sms-mcp-server'

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