search_emails
电子邮件 · macOS
效果: 读取. 状态: 受限可用.
“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。
macOS
用途
当用户想在这台 Mac 上查找特定邮件(Apple Mail——添加到 Mail.app 的任何账户)时使用。默认搜索主题和发件人;传入 scope="body" 或 scope="all" 还会搜索邮件正文(参见响应中的 search_coverage——本地索引仍在构建时,正文搜索可能不完整)。垃圾箱和垃圾邮件文件夹会被排除,除非 include_trash=true 或 mailbox 指定了它们。对于未添加到 Mail.app 的 Microsoft 365 邮箱,请使用 m365_search_emails。 重要:在有 2 个及以上账户的设备上,请使用 account=<name> 调用(来自 list_email_accounts)。不传时,且快速索引无法回答的情况下,search_emails 会返回账户列表,而不是扫描所有账户——一次调用扫描所有账户没有时间限制,还可能阻塞 Mail 处理其他请求。只有 1 个账户则不受影响。
必填输入
query
输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。
权限与确认
架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。
- 仅使用用户在此平台上授权的应用、账户和资源。请查阅此工具针对平台的说明,以了解其连接和权限要求;本目录不声称需要额外的 OAuth 范围或操作系统授权。
英文规范技术架构 — macOS
{
"properties": {
"account": {
"description": "Mail.app account to search (from list_email_accounts). On a Mac with 2+ accounts this is effectively required: without it, and when the fast index cannot answer, the tool returns the account list instead of scanning them all.",
"type": "string"
},
"include_trash": {
"default": "false",
"description": "Also return matches from trash and junk folders. Default false: a search of every folder leaves them out. Not needed when mailbox names the folder.",
"type": "boolean"
},
"limit": {
"default": "20",
"description": "Maximum number of matches to return.",
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"mailbox": {
"description": "Restrict the search to one folder, by name (see list_email_folders). Defaults to every folder of the account.",
"type": "string"
},
"query": {
"description": "What to look for. Matched against subject and sender, or also the body when scope is \"body\" or \"all\".",
"type": "string"
},
"recipient": {
"description": "Only messages sent to this address or name (To or Cc), e.g. one of the user's own aliases. Narrows the matches of query.",
"type": "string"
},
"scope": {
"default": "metadata",
"description": "\"metadata\" (default, subject+sender — fast, unchanged behavior), \"body\" (message body only, via a local index — see search_coverage in the response), or \"all\" (subject+sender+body).",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}文档示例
search_emails 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。
{
"query": "launch checklist"
}