search_emails
Search emails by keyword in subject and sender fields to find specific messages in your inbox. Set a limit to control results.
Instructions
키워드로 이메일을 검색합니다. 제목과 발신자에서 검색합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | 검색 키워드 | |
| limit | No | 검색 범위 최근 N건 (기본: 50) |
Implementation Reference
- src/email-tools.ts:87-107 (handler)The handler logic for the 'search_emails' tool, which validates inputs, fetches email headers, and filters them by keyword.
case "search_emails": { if (!args.keyword || typeof args.keyword !== "string") { return { content: [{ type: "text" as const, text: "오류: keyword는 필수 문자열 파라미터입니다." }], isError: true }; } const keyword = args.keyword.toLowerCase(); const limit = Math.min((args.limit as number) || 50, 100); const headers = await withConnection(config, (client) => client.list(limit)); const matched = headers.filter( (h) => h.subject.toLowerCase().includes(keyword) || h.from.toLowerCase().includes(keyword) ); return { content: [ { type: "text" as const, text: `"${args.keyword}" 검색 결과 (${matched.length}건):\n\n${formatEmailList(matched)}`, }, ], }; } - src/email-tools.ts:19-30 (schema)The schema definition for the 'search_emails' tool, specifying input arguments.
{ name: "search_emails", description: "키워드로 이메일을 검색합니다. 제목과 발신자에서 검색합니다.", inputSchema: { type: "object" as const, properties: { keyword: { type: "string", description: "검색 키워드" }, limit: { type: "number", description: "검색 범위 최근 N건 (기본: 50)" }, }, required: ["keyword"], }, },