Grok Bot
Search Gmail Spam from Grok Bot
Search Gmail Spam from Grok Bot
list_labels can show Spam thread counts while search_threads with in:spam, label:SPAM, or is:spam returns empty. Staff on Grok Bot Gmail: search_threads returns empty for Spam explained why and how to reach those threads.
Why the empty result happens
The Gmail connector sits on Google’s hosted Gmail search. That search excludes Spam and Trash by default. The connector’s includeTrash option only adds Trash. Operators such as in:spam, label:SPAM, and is:spam do not override that default, so you get {} even when list_labels still reports a Spam count.
Query that reaches Spam
- Confirm the Gmail connector is connected (see Connect Gmail so Grok can search your mail).
- Ask the bot to call
search_threadswith this exact query:in:anywhere label:SPAM. - If that returns empty and your Spam threads are unread, try
in:anywhere is:unread, then filter results that carry the SPAM label id. - Reply on the forum thread with which step returned threads if you still need staff help.
Staff asked users to try those two in:anywhere forms before assuming a connector bug.
What you still cannot do
The connector can move threads to Trash or Spam and change labels. Google’s server does not expose permanent delete through this path, so you cannot “clear” Spam entirely from the connector even after the threads appear.
Pitfalls
- Trusting
list_labelsSpam counts as proof thatin:spamshould work — the count and the search defaults disagree by design. - Passing only
includeTrashwhen you meant Spam. - Expecting a permanent empty-Spam action from the connector.