Skip to main content
Glama
jhw7500

Email MCP Server

by jhw7500

fetch_email_thread

Retrieve email conversation threads by searching subject keywords across recent messages to restore complete discussions.

Instructions

제목 키워드로 이메일 스레드(대화)를 복원합니다. 최근 100건에서 검색합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subject_keywordYes제목에 포함된 키워드

Implementation Reference

  • The implementation of the `fetch_email_thread` tool logic, which retrieves and sorts emails matching a subject keyword.
    case "fetch_email_thread": {
      if (!args.subject_keyword || typeof args.subject_keyword !== "string") {
        return { content: [{ type: "text" as const, text: "오류: subject_keyword는 필수 문자열 파라미터입니다." }], isError: true };
      }
      const keyword = args.subject_keyword.toLowerCase();
      const emails = await withConnection(config, async (client) => {
        const headers = await client.list(100);
        const matched = headers.filter((h) =>
          h.subject.toLowerCase().includes(keyword)
        );
        const results = [];
        for (const h of matched) {
          try {
            results.push(await client.getEmail(h.id));
          } catch { /* skip */ }
        }
        return results.sort(
          (a, b) => new Date(a.date).getTime() - new Date(b.date).getTime()
        );
      });
    
      if (emails.length === 0) {
        return {
          content: [{ type: "text" as const, text: `"${args.subject_keyword}" 관련 스레드를 찾을 수 없습니다.` }],
        };
      }
    
      const text = emails
        .map(
          (e) =>
            `### ${e.subject}\n` +
            `From: ${e.from} | ${e.date ? new Date(e.date).toLocaleString("ko-KR") : ""}\n\n` +
            `${e.body}`
        )
        .join("\n\n---\n\n");
    
      return {
        content: [{ type: "text" as const, text: `스레드 (${emails.length}건):\n\n${text}` }],
      };
    }
  • The definition and schema for `fetch_email_thread` tool.
    {
      name: "fetch_email_thread",
      description: "제목 키워드로 이메일 스레드(대화)를 복원합니다. 최근 100건에서 검색합니다.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subject_keyword: { type: "string", description: "제목에 포함된 키워드" },
        },
        required: ["subject_keyword"],
      },
    },
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 the scope ('최근 100건에서 검색합니다') and implies a read-only operation by using '복원합니다' (restores), but lacks critical details such as authentication requirements, rate limits, error conditions, or what '복원' (restoration) entails (e.g., does it fetch full conversation history?). For a tool with zero annotation coverage, this is insufficient.

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 and front-loaded, consisting of two sentences that directly state the tool's purpose and scope. There is no wasted language, and it efficiently communicates core information. However, it could be slightly improved with more structured guidance, preventing a perfect score of 5.

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 (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and scope but lacks details on behavioral traits, output format, or differentiation from siblings. Without annotations or an output schema, the description should provide more context (e.g., what '복원' returns), making it incomplete for optimal agent use.

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 schema description coverage is 100%, with the parameter 'subject_keyword' fully documented in the schema as '제목에 포함된 키워드' (keyword included in the subject). The description adds no additional parameter semantics beyond what the schema provides, such as format examples or search behavior specifics. According to guidelines, when schema coverage is high (>80%), the baseline score is 3 even without param info in the description.

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: '제목 키워드로 이메일 스레드(대화)를 복원합니다' (Restores email threads/conversations by subject keyword). It specifies the verb ('복원합니다' - restores) and resource ('이메일 스레드' - email threads), and mentions the scope ('최근 100건에서 검색합니다' - searches in the most recent 100 items). However, it doesn't explicitly differentiate from sibling tools like 'search_emails' or 'fetch_recent_emails', which prevents a score of 5.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance. It states the tool searches within the most recent 100 items, but offers no explicit advice on when to use this tool versus alternatives like 'search_emails' or 'fetch_recent_emails'. There's no mention of prerequisites, exclusions, or comparative contexts with sibling tools, leaving the agent with little guidance on tool selection.

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