list_emails
Retrieve emails from your Gmail account with filtering options. Use this tool to view messages from specific labels like INBOX, SENT, or STARRED with customizable result limits.
Instructions
List emails from the user's mailbox.
This tool retrieves a list of emails from the specified label in the user's
Gmail account, with basic information about each email.
Prerequisites:
- The user must be authenticated. Check auth://status resource first.
- If not authenticated, guide the user through the authentication process.
Args:
max_results (int, optional): Maximum number of emails to return. Defaults to 10.
label (str, optional): The label to filter by. Defaults to "INBOX".
Common labels: "INBOX", "SENT", "DRAFT", "TRASH", "SPAM", "STARRED"
Returns:
Dict[str, Any]: The list of emails including:
- emails: List of email objects with basic information and links
- next_page_token: Token for pagination (if applicable)
Example usage:
1. First check authentication: access auth://status resource
2. If authenticated, call list_emails(max_results=5, label="INBOX")
3. If not authenticated, guide user to authenticate first
4. Always include the email_link when discussing specific emails with the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | ||
| label | No | INBOX |