download_attachment
Download email attachments to a specified directory path using email ID and filename parameters.
Instructions
이메일 첨부파일을 지정된 경로에 다운로드합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| email_id | Yes | 이메일 ID | |
| filename | Yes | 첨부파일 이름 | |
| save_path | No | 저장 디렉토리 (기본: /tmp/) |
Implementation Reference
- src/attachment-tools.ts:49-60 (handler)The handler logic for 'download_attachment', which saves the attachment content to the specified file path.
case "download_attachment": { const saveDir = (args.save_path as string) || tmpdir(); const safeName = basename(attachment.filename || filename); const filePath = join(saveDir, safeName); await writeFile(filePath, attachment.content); return { content: [{ type: "text" as const, text: `다운로드 완료: ${filename} (${(attachment.size / 1024).toFixed(1)}KB)\n경로: ${filePath}`, }], }; } - src/attachment-tools.ts:7-20 (schema)Definition and input schema for the 'download_attachment' tool.
export const attachmentToolDefinitions = [ { name: "download_attachment", description: "이메일 첨부파일을 지정된 경로에 다운로드합니다.", inputSchema: { type: "object" as const, properties: { email_id: { type: "number", description: "이메일 ID" }, filename: { type: "string", description: "첨부파일 이름" }, save_path: { type: "string", description: "저장 디렉토리 (기본: /tmp/)" }, }, required: ["email_id", "filename"], }, },