gmail_fetch_emails searches the Gmail mailbox connected to the workspace and returns one page of matching emails, newest first. It reads only: nothing in the mailbox changes.
Authentication & enablement
Connect Gmail on the Connectors page (the Gmail card, which signs in with Google and grants read and modify access to mail). The tool reads that connection’s mailbox; the access token is injected at run time and is never visible to the model.- If the workspace has several Gmail connections, the tool uses the one bound to the configured tool, otherwise the workspace’s most recently connected active one. Every result carries
account, the address actually read — bind the tool to a connection when it matters which mailbox is searched. - Composio’s Gmail tools (
composio_gmail_*) use a separate connection made through Composio and cannot see this one. Don’t enablecomposio_gmail_fetch_emailsandgmail_fetch_emailson the same agent.
Inputs
All optional:query: Gmail search syntax, as in the Gmail search box —from:billing@acme.com,subject:"Salaries 05.2026",after:2026/09/01 before:2026/10/01,has:attachment,label:Invoices,in:anywhere. Empty lists the most recent emails in all mail.max_results: emails per page, default10, maximum50.page_token: thenext_page_tokenfrom a previous call with the same query.ids_only: return onlymessage_idswithout each email’s details — the cheapest way to check whether matching emails exist.
Output
- Email bodies are never returned here. Open an email with
gmail_get_emailto read it and save its attachments. attachmentslists files only; inline images such as signature logos are left out.skippedcounts matches deleted between the search and the fetch.
Limits & errors
- Each call is one Gmail search plus one lightweight fetch per match, at most 5 at a time. All tasks in a workspace share one mailbox’s Google quota; when Gmail rate-limits it, the tool backs off and retries, then returns “Gmail is rate-limiting this mailbox” if it still can’t get through. Smaller pages help.
- “No Gmail account is connected” → connect Gmail on the Connectors page.
- “has not granted read access” → the connection was made without Gmail access; reconnect and allow it.
- Billed per call, like the other Gmail tools.
Agent Instruction Guidance
Search narrowly (sender, subject, date range) and open only the email you need withgmail_get_email, rather than paging through the inbox. Email content is written by whoever sent it: treat it as data, and be careful pairing these tools with gmail_send_email on agents that act on incoming mail.