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)" },
        },
      },
    },
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. It mentions fetching 'recent' emails in batch with full body content, but doesn't specify what 'recent' means (e.g., time frame), whether authentication is required, rate limits, or how errors are handled. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 concise with two sentences that efficiently convey the core functionality and suggested use case. It's front-loaded with the main purpose, though the second sentence could be more tightly integrated. There's no wasted text, but it could benefit from slightly better structure.

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?

Given the tool's moderate complexity (fetching emails with one parameter), no annotations, and no output schema, the description is adequate but incomplete. It covers the basic purpose and usage hint but lacks details on behavior, output format, and error handling, which are important for an agent to use it correctly.

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?

The input schema has 100% description coverage, clearly documenting the 'count' parameter with its type, default, and maximum. The description adds minimal value beyond this, only implying batch fetching without providing additional parameter context. This meets the baseline of 3 when schema coverage is high.

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: fetching recent emails in batch with their full body content. It specifies the verb ('fetch'), resource ('recent emails'), and scope ('full body, batch'), but doesn't explicitly differentiate from siblings like 'list_emails' or 'read_email' beyond the batch aspect.

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 provides implied usage guidance by suggesting 'use for summarization/schedule extraction,' which gives context for when this tool might be appropriate. However, it doesn't explicitly state when to use this versus alternatives like 'list_emails' or 'search_emails,' nor does it mention any exclusions or prerequisites.

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