email_search_messages
Searches one, several, or all Read-enabled mailboxes and returns matching messages newest-first, merged across accounts, each tagged with the account_id it came from. This is the default way to find mail. Omit account_ids to search every connected account with Read on; pass account_ids to scope to specific mailboxes from email_accounts_list. Results are metadata plus a snippet unless include_body is true. Page with limit and cursor; pass the same filters back alongside the cursor. A per-account failure does not fail the call: successful accounts still return results and the failures appear in account_errors with their own code, so check that array before telling the user a search found nothing.
Input fields
{
"type": "object",
"properties": {
"account_ids": {
"description": "Mailboxes to search, from email_accounts_list. Omit to search every connected account that has Read enabled. Naming an account whose Read permission is off is an error; omitting it simply skips it.",
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
{
"type": "null"
}
]
},
"query": {
"description": "Provider-neutral search syntax, translated to Gmail search, Microsoft Graph, or IMAP SEARCH per account. Supported terms: free text, from:address, from-domain:example.com, to:address, subject:text, after:YYYY-MM-DD, before:YYYY-MM-DD, is:read, is:unread, is:starred, has:attachment, folder:name, label:name. Do not send raw Gmail or Graph syntax. Terms a provider cannot evaluate are reported back, never silently dropped.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"folder": {
"description": "Restrict to one folder or label, by folder id or name (e.g. INBOX).",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"unread_only": {
"description": "Only messages that are still unread.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"has_attachment": {
"description": "true for messages with attachments, false for those without, omit for either.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"date_from": {
"description": "Inclusive lower bound, YYYY-MM-DD.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"date_to": {
"description": "Exclusive upper bound, YYYY-MM-DD.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"include_body": {
"description": "Include full message bodies. Defaults to false — results carry metadata and a snippet. Leave it false while narrowing a search and fetch the one message you want with email_get_message.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"limit": {
"description": "Maximum results in this page. Clamped to the server maximum; omit for the server default.",
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"cursor": {
"description": "Opaque cursor from a previous response's next_cursor. Pass the same filters alongside it — a cursor is bound to the search that produced it.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
}
}Tool behavior
Declared read-only. Actual provider grants and account access apply.
Inspect isError and per-account errors. General write tools do not all enforce exact-plan approval. This reference does not certify any current AI client version.

YOUR INBOXES.
UNDER CONTROL.
Get started Start with a free account and one read-only search. Existing accounts keep their connection.