Skip to main content
Glama
jhw7500

Email MCP Server

by jhw7500

fetch_recent_emails

Retrieve recent email bodies in batches for summarization or schedule extraction. Specify count to fetch up to 10 emails.

Instructions

최근 N개 이메일의 전체 본문을 배치로 가져옵니다. 요약/일정 추출 시 사용하세요.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo가져올 이메일 수 (기본: 5, 최대: 10)

Implementation Reference

  • The handler implementation for the "fetch_recent_emails" tool. It connects to the POP3 server, fetches the requested number of recent emails, processes their body text with size limiting, and formats the output.
    case "fetch_recent_emails": {
      const count = Math.min((args.count as number) || 5, 10);
      const emails = await withConnection(config, async (client) => {
        const total = await client.getMessageCount();
        const results = [];
        for (let i = total; i > Math.max(0, total - count); i--) {
          try {
            results.push(await client.getEmail(i));
          } catch { /* skip */ }
        }
        return results;
      });
    
      const text = emails
        .map((e) => {
          const body = e.body.length > 20000
            ? e.body.slice(0, 20000) + "\n...(20,000자 제한)"
            : e.body;
          return (
            `## ${e.subject}\n` +
            `From: ${e.from} | ${e.date ? new Date(e.date).toLocaleString("ko-KR") : ""}\n` +
            `${e.attachments.length > 0 ? `첨부: ${e.attachments.map((a) => a.filename).join(", ")}\n` : ""}` +
            `\n${body}`
          );
        })
        .join("\n\n---\n\n");
    
      return { content: [{ type: "text" as const, text }] };
    }
  • The MCP tool schema definition for "fetch_recent_emails", including its description and input validation schema.
      name: "fetch_recent_emails",
      description: "최근 N개 이메일의 전체 본문을 배치로 가져옵니다. 요약/일정 추출 시 사용하세요.",
      inputSchema: {
        type: "object" as const,
        properties: {
          count: { type: "number", description: "가져올 이메일 수 (기본: 5, 최대: 10)" },
        },
      },
    },

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