Skip to main content
Glama

search_emails

Find specific emails in Gmail using advanced search queries. Filter messages by sender, recipient, subject, attachments, date, or read status to locate relevant correspondence quickly.

Instructions

Search for emails using Gmail's search syntax. This tool searches for emails matching the specified query using Gmail's powerful search syntax. Prerequisites: - The user must be authenticated. Check auth://status resource first. - If not authenticated, guide the user through the authentication process. Args: query (str): The search query using Gmail's search syntax. Examples: - "from:example@gmail.com" - Emails from a specific sender - "to:example@gmail.com" - Emails to a specific recipient - "subject:meeting" - Emails with "meeting" in the subject - "has:attachment" - Emails with attachments - "is:unread" - Unread emails - "after:2023/01/01" - Emails after January 1, 2023 max_results (int, optional): Maximum number of emails to return. Defaults to 10. Returns: Dict[str, Any]: The search results including: - query: The search query used - emails: List of email objects matching the query with links - next_page_token: Token for pagination (if applicable) Example usage: 1. First check authentication: access auth://status resource 2. If authenticated, search for emails: search_emails(query="from:example@gmail.com") 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
NameRequiredDescriptionDefault
queryYes
max_resultsNo

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bastienchabal/gmail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server