Skip to main content
Glama

nworks_mail_read

Retrieve detailed email content including body text and attachments from LINE WORKS mailboxes using mail ID. Requires OAuth authentication with mail.read scope.

Instructions

특정 메일의 상세 내용(본문, 첨부파일 등)을 조회합니다. '이 메일 내용 보여줘' 등의 요청에 사용. mailId는 nworks_mail_list로 조회 가능. User OAuth 인증 필요 (mail.read scope)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailIdYes메일 ID (nworks_mail_list로 조회 가능)
userIdNo대상 사용자 ID (미지정 시 me)

Implementation Reference

  • The actual implementation of the mail reading logic.
    export async function readMail(
      mailId: number,
      userId = "me",
      profile = "default"
    ): Promise<MailDetail> {
      const url = `${BASE_URL}/users/${sanitizePathSegment(userId)}/mail/${sanitizePathSegment(String(mailId))}`;
    
      if (process.env["NWORKS_VERBOSE"] === "1") {
        console.error(`[nworks] GET ${url}`);
      }
    
      const res = await authedFetch(url, { method: "GET" }, profile);
    
      if (!res.ok) return handleError(res);
    
      return (await res.json()) as MailDetail;
    }
  • The tool registration and invocation of the handler for 'nworks_mail_read'.
    server.tool(
      "nworks_mail_read",
      "특정 메일의 상세 내용(본문, 첨부파일 등)을 조회합니다. '이 메일 내용 보여줘' 등의 요청에 사용. mailId는 nworks_mail_list로 조회 가능. User OAuth 인증 필요 (mail.read scope)",
      {
        mailId: z.number().describe("메일 ID (nworks_mail_list로 조회 가능)"),
        userId: z.string().optional().describe("대상 사용자 ID (미지정 시 me)"),
      },
      async ({ mailId, userId }) => {
        try {
          const result = await mailApi.readMail(
            mailId,
            userId ?? "me"
          );
          const mail = result.mail;
  • Type definition for MailDetail (the output of the mail reading operation).
    export interface MailDetail {
      mail: {
        mailId: number;
        folderId: number;
        status: number;
        from: MailAddress;
        to: MailAddress[];
        cc?: MailAddress[];
        bcc?: MailAddress[];
        subject: string;
        body: string;
        receivedTime: string;
        sentTime?: string;
        size: number;
        securityLevel?: string;
      };
      attachments?: Array<{
        attachmentId: number;
        contentType: string;
        filename: string;
        size: number;
      }>;
    }

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/yjcho9317/nworks'

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