本文へスキップ
すべてのツール

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 はすべてのアカウントをスキャンせず、アカウントの一覧を返します。すべてのアカウントを 1 回の呼び出しでスキャンすると時間制限がなく、他のリクエストに対して Mail をブロックすることもあります。アカウントが 1 つだけの場合は影響しません。

必須入力

入力名はツールが要求する正確な形式のままです。英語の正規技術定義は下の展開可能なスキーマにあります。

権限と確認

スキーマには明示的な確認パラメータがありません。これは無許可の操作を認めるものではありません。効果を確認し、承認を得てください。

英語の正規技術スキーマ — 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"
}