Search Gmail
Find emails using natural language—interpret what user actually wants
3
Interpret the user's request using the intent patterns. State what you're searching for and why—let them correct you if wrong. Translate to Gmail query using operators from the search slice.
5
Lead with the answer. If they're looking for something specific, surface the best match first with reasoning. Group results intelligently: by sender if many senders, by thread if few, by date for time-based queries.
6
If results are too broad (30+), offer to narrow: 'Want me to focus on just this week?' If results are empty, offer alternatives: 'No exact matches—want me to try related terms?'
To run this task you must have the following required information:
What to search for (natural language or Gmail query), optional filters (sender, date range, unread only, has attachment)
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Inbox Intent Patterns]: Read the documentation in: `./skills/sauna//resources/context/gmail.inbox.intent.md` (Understand what user probably means, not just literal words)
2. [Read Gmail Search Operators]: Read the documentation in: `./skills/sauna//resources/context/gmail.inbox.search.md` (Gmail query operators reference)
3. Interpret the user's request using the intent patterns. State what you're searching for and why—let them correct you if wrong. Translate to Gmail query using operators from the search slice.
4. [Gather Arguments: Fetch Gmail Messages] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `query`: Gmail query constructed from interpreted intent
- `maxResults` (default: "50"): 30 for specific searches, 50 for broader exploration
- `outputPath` (default: "session/emails.json"): session/search-results.json
5. [Run Code: Fetch Gmail Messages]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/gmail.inbox.fetch/preview,
"args": [
"query",
"maxResults",
"outputPath"
]
},
"packages": null
}
```
6. Lead with the answer. If they're looking for something specific, surface the best match first with reasoning. Group results intelligently: by sender if many senders, by thread if few, by date for time-based queries.
7. If results are too broad (30+), offer to narrow: 'Want me to focus on just this week?' If results are empty, offer alternatives: 'No exact matches—want me to try related terms?'