list_emails
List Gmail emails by label, newest first, and narrow results with Gmail search queries. Returns IDs, subjects, senders, dates, flags, snippets, and paging tokens for next pages.
Instructions
List emails in a Gmail label (default INBOX), newest first, optionally narrowed with a Gmail search query. Returns IDs, thread IDs, subject, sender, date, unread/attachment flags, and a snippet. Use pageToken to page through results.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Label ID to list. System labels: INBOX, SENT, DRAFT, SPAM, TRASH, STARRED, IMPORTANT, UNREAD, CATEGORY_PERSONAL, CATEGORY_SOCIAL, CATEGORY_PROMOTIONS, CATEGORY_UPDATES, CATEGORY_FORUMS. For user labels use the ID from list_labels. Pass an empty string for all mail. | INBOX |
| query | No | Optional Gmail search query to narrow results, e.g. "is:unread", "from:someone@example.com", "after:2024/01/01 before:2024/02/01", "has:attachment". | |
| pageToken | No | Token from a previous response ("nextPageToken") to fetch the next page | |
| maxResults | No | Number of emails to return (max 50) |