list_emails
Retrieve recent emails with subject, sender, and timestamp details. Specify count to view up to 50 messages for quick inbox overview.
Instructions
최근 이메일 목록을 조회합니다. 제목, 발신자, 수신일시를 포함합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | 조회할 이메일 수 (기본: 10, 최대: 50) |
Implementation Reference
- src/email-tools.ts:81-85 (handler)The handler logic for 'list_emails' which calculates the count, retrieves email headers via a POP3 connection, and formats the result.
case "list_emails": { const count = Math.min((args.count as number) || 10, 50); const headers = await withConnection(config, (client) => client.list(count)); return { content: [{ type: "text" as const, text: formatEmailList(headers) }] }; } - src/email-tools.ts:6-18 (schema)The definition and input schema for the 'list_emails' tool.
{ name: "list_emails", description: "최근 이메일 목록을 조회합니다. 제목, 발신자, 수신일시를 포함합니다.", inputSchema: { type: "object" as const, properties: { count: { type: "number", description: "조회할 이메일 수 (기본: 10, 최대: 50)", }, }, }, }, - src/email-tools.ts:65-75 (helper)Helper function to format the list of email headers into a string for the tool output.
function formatEmailList(headers: EmailHeader[]): string { if (headers.length === 0) return "이메일이 없습니다."; return headers .map( (h, i) => `${i + 1}. **${h.subject}**\n` + ` From: ${h.from} | ${h.date ? new Date(h.date).toLocaleString("ko-KR") : "날짜 없음"}\n` + ` ID: ${h.id}` ) .join("\n\n"); }