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"],
      },
    },
Behavior2/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. It states the tool extracts and returns text, but doesn't mention error handling (e.g., unsupported file types), performance characteristics, or whether the operation is read-only/destructive. The mention of Claude summarization adds some context about intended use, but lacks operational details.

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 efficiently structured in two sentences: one stating the core functionality and supported file types, and another explaining the purpose for Claude integration. Both sentences add value, though the second sentence could be integrated more tightly with the first.

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

Completeness3/5

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

For a tool with 2 parameters, 100% schema coverage, and no output schema, the description provides adequate basic context about what the tool does and why. However, it lacks details about return format (e.g., structured text vs raw extraction), error conditions, or limitations of the text extraction process that would be helpful given no annotations exist.

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 both parameters (email_id and filename) adequately. The description doesn't add any parameter-specific information beyond what's in the schema, such as format examples or constraints on filename matching. Baseline 3 is appropriate when schema provides complete parameter documentation.

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 tool's purpose: extracting text from email attachments (pptx, docx, xlsx, pdf, txt) and returning it. It specifies the resource (email attachments) and the action (text extraction), but doesn't explicitly differentiate from sibling tools like 'download_attachment' which handles file downloads rather than text extraction.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning 'Claude가 내용을 요약할 수 있도록' (so Claude can summarize the content), suggesting this tool is for content analysis rather than file retrieval. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'download_attachment' for binary files or 'read_email' for email body text.

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

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