create_draft
电子邮件 · macOS
效果: 写入. 状态: 受限可用.
“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。
macOS
用途
将电子邮件保存到 Mail.app 的“草稿”文件夹,供用户检查并手动发送;它绝不会发送邮件。可使用 `to`/`subject` 与 `body` 或 `html_body` 撰写新草稿,也可使用 `reply_to_message_id`、`reply_all` 与 `body` 或 `html_body` 保存回复草稿;响应会给出主题,并在 Mail 回显已保存的草稿后,给出草稿所在的邮箱(新草稿为 `mailbox`,回复草稿为 `draft_mailbox`)及其当前的邮件 id;如果 Mail 尚未显示该草稿,则不会给出邮箱名称。回复草稿包含你的文本,后接原邮件的纯文本引用("On <date>, <sender> wrote:",原邮件各行以 `> ` 开头),而不是 Mail 的样式化引用;在回复草稿中,`html_body` 会被转换为纯文本。引用存在时,响应中的 `quoted_original` 为 true;当原邮件没有可读文本时为 false,并附带说明。回复草稿的响应包含 `threaded`:true 表示已回读保存的草稿,且其标头引用源邮件(它会显示在会话内);false 表示保存时不含会话串标头(请将警告转告用户);"unconfirmed" 表示未能及时回读(例如 Exchange 同步延迟)。在多账户 Mac 上,传入 `account`(来自 list_email_accounts 的账户名称)或 `from`(发件人地址),可将草稿放入该账户的“草稿”;否则会放入默认账户。通过传入 `attachments`(以逗号分隔的绝对文件路径,例如一份 PDF 报价单)来添加附件,它们会附加到已保存的草稿。适用于希望由 AI 撰写邮件、但坚持自己发送的谨慎用户。需要 confirm=true 才会真正保存;否则返回预览,不会改动 Mail.app。
必填输入
此平台的架构未声明必填输入,但仍可能存在可选选择器或运行时要求。
权限与确认
架构声明了明确的确认参数。请检查预览,并按此平台的契约授权实际操作。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — macOS
{
"properties": {
"account": {
"description": "Account name (from list_email_accounts) whose Drafts folder receives the draft. Alternative to `from`.",
"type": "string"
},
"attachments": {
"description": "Files to attach, as comma-separated absolute paths (e.g. a PDF).",
"type": "string"
},
"bcc": {
"description": "BCC address(es), comma-separated.",
"type": "string"
},
"body": {
"description": "Plain-text body of the draft.",
"type": "string"
},
"cc": {
"description": "CC address(es), comma-separated.",
"type": "string"
},
"confirm": {
"default": "false",
"description": "Must be true to actually save the draft. Without it, returns a preview of the recipient/sender, subject, and that the body will be saved.",
"type": "boolean"
},
"from": {
"description": "Sender address — on a multi-account Mac, selects which account's Drafts to use. Alternative to `account`.",
"type": "string"
},
"html_body": {
"description": "HTML body of the draft. Takes precedence over `body` when both are given.",
"type": "string"
},
"reply_all": {
"default": "false",
"description": "For a reply draft, include all original recipients (reply-all) instead of just the sender.",
"type": "boolean"
},
"reply_to_message_id": {
"description": "Message id (from list_emails/search_emails) to draft a reply to, instead of a new message.",
"type": "string"
},
"subject": {
"description": "Subject line for a new draft. Ignored for reply drafts (they inherit the original subject).",
"type": "string"
},
"to": {
"description": "Recipient address(es) for a new draft, comma-separated. May be left empty: the draft is saved without a recipient, to be added in Mail. Omit for a reply draft (uses reply_to_message_id).",
"type": "string"
}
},
"type": "object"
}文档示例
create_draft 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"body": "Can we review the launch checklist on Tuesday?",
"confirm": false,
"subject": "Planning meeting",
"to": "alex@example.com"
}