Skip to main content
Glama
jhw7500

Email MCP Server

by jhw7500

read_attachment_text

Extract text from email attachments like PDFs and Office documents to analyze content or enable summarization by AI assistants.

Instructions

이메일 첨부파일(pptx, docx, xlsx, pdf, txt)의 텍스트를 추출하여 반환합니다. Claude가 내용을 요약할 수 있도록 텍스트로 변환합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
email_idYes이메일 ID
filenameYes첨부파일 이름

Implementation Reference

  • Handler for the 'read_attachment_text' tool, which extracts text from an email attachment using 'office-text-extractor'.
    case "read_attachment_text": {
      const tempPath = join(tmpdir(), `email-att-${Date.now()}-${filename}`);
      await writeFile(tempPath, attachment.content);
      try {
        const { getTextExtractor } = await import("office-text-extractor");
        const extractor = getTextExtractor();
        const text = await extractor.extractText({ input: tempPath, type: "file" });
        const truncated = text.length > 30000
          ? text.slice(0, 30000) + "\n\n...(30,000자 제한으로 잘림)"
          : text;
        return {
          content: [{
            type: "text" as const,
            text: `**${filename}** 텍스트 내용:\n\n---\n${truncated}`,
          }],
        };
      } finally {
        await unlink(tempPath).catch(() => {});
      }
    }
  • Definition and input schema for the 'read_attachment_text' tool.
    {
      name: "read_attachment_text",
      description: "이메일 첨부파일(pptx, docx, xlsx, pdf, txt)의 텍스트를 추출하여 반환합니다. Claude가 내용을 요약할 수 있도록 텍스트로 변환합니다.",
      inputSchema: {
        type: "object" as const,
        properties: {
          email_id: { type: "number", description: "이메일 ID" },
          filename: { type: "string", description: "첨부파일 이름" },
        },
        required: ["email_id", "filename"],
      },
    },

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/jhw7500/email-mcp-server'

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