search_emails
Search Apple Mail emails by query in subject or sender fields. Find specific messages using account, mailbox, and limit parameters to filter results.
Instructions
Search for emails matching a query string.
Searches in both subject and sender fields (case-insensitive).
Args: query: Search term to look for account: Account name. Uses JXA_MAIL_DEFAULT_ACCOUNT env var or first account if not specified. mailbox: Mailbox name. Uses JXA_MAIL_DEFAULT_MAILBOX env var or "Inbox" if not specified. limit: Maximum number of results (default: 50)
Returns: List of matching emails sorted by date (newest first).
Example: >>> search_emails("invoice", "Work") [{"subject": "Invoice #123", "sender": "billing@vendor.com", ...}]
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| account | No | ||
| mailbox | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |