Naar de inhoud
Alle hulpmiddelen

search_emails

E-mail · macOS

Effect: lezen. Status: voorwaardelijk beschikbaar.

‘Voorwaardelijke beschikbaarheid’ betekent dat het hulpmiddel kan afhangen van versie, platform, machtigingen, account of configuratie. Het is niet in elke installatie actief.

macOS

Doel

Gebruik dit wanneer de gebruiker specifieke e-mails op deze Mac wil vinden (Apple Mail — elk account dat aan Mail.app is toegevoegd). Doorzoekt standaard onderwerp en afzender; geef scope="body" of scope="all" mee om ook de berichtinhoud te doorzoeken (zie search_coverage in het antwoord — een zoekopdracht in de inhoud kan gedeeltelijk zijn zolang de lokale index nog wordt opgebouwd). Prullenbak- en ongewenste-mailmappen blijven buiten beschouwing, tenzij include_trash=true of mailbox er een noemt. Gebruik m365_search_emails voor een Microsoft 365-mailbox die NIET aan Mail.app is toegevoegd. BELANGRIJK: geef op machines met 2+ accounts account=<name> mee (uit list_email_accounts). Zonder dat, en wanneer de snelle index niet kan antwoorden, geeft search_emails de accountlijst terug in plaats van ze allemaal te scannen — alle accounts in één aanroep scannen heeft geen tijdslimiet en kan Mail ook voor andere verzoeken blokkeren. Bij precies 1 account is dit niet van toepassing.

Vereiste invoer

De namen blijven exact zoals het hulpmiddel ze vereist. De canonieke technische definities in het Engels staan in het uitklapbare schema hieronder.

Machtigingen en bevestiging

Het schema bevat geen expliciete bevestigingsparameter. Dit geeft geen toestemming om te handelen; controleer het effect en vraag autorisatie.

Canoniek technisch schema in het Engels — 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"
}

Documentatievoorbeeld

Documentatievoorbeeld voor search_emails. Voer dit voorbeeld niet uit. De getoonde argumenten verwijzen naar fictieve gegevens; zoek vóór een echte aanroep de werkelijke identificatoren op en vraag toestemming.

{
  "query": "launch checklist"
}