list_emails
Search Gmail inbox by query and retrieve email IDs, subjects, and snippets for reading or replying. Supports Gmail search syntax to filter by sender, subject, date, or attachments.
Instructions
Search inbox for emails matching a query string.
Returns a list of emails with their IDs, subjects, from addresses, dates,
snippets, and labels. IDs can be passed to read_email or reply_email.
Required: none — both params have defaults.
Optional:
query (str, default="") — Gmail search syntax.
Examples: "from:alice@example.com", "subject:invoice is:unread",
"after:2026/01/01 before:2026/01/31", "has:attachment".
Leave empty to get most recent inbox emails.
max_results (int, default=5) — how many emails to return. Max 500.
Returns on success:
{"total": N, "emails": [{"id": "...", "subject": "...", "from": "...",
"date": "...", "snippet": "...", "labels": [...]}]}
Workflow note: The "id" field in each email is a Gmail message ID —
pass it to read_email, reply_email, or get_thread_messages.
Leave query empty to get recent inbox. Use Gmail search syntax
to filter: from:, subject:, after:, before:, is:unread, has:attachment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| max_results | No |