search_emailsfinds messages — compact hit lists, no bodies.get_emailreads one message in full.get_threadlists every message in a conversation.
Find what needs action
Prompt
todo flag with a date filter:
Tool call — search_emails
Result
Filter by email type
Thekeywords filter takes any of the ten classified types — direct, newsletter, promotional, notification, ticket, receipt, order, scheduling, security_alert, terms — plus the orthogonal todo flag, combined with OR:
Prompt
Tool call — search_emails
Find transactional mail that never says what it is
A booking confirmation is titled after the film, an invoice after the vendor — the word you would search for appears nowhere in the message. This is where the type filter replaces free text rather than narrowing it:Prompt
Tool call — search_emails
after/before filter the received date, and the confirmation arrived when the seats were booked, not when the film ran. Anchor on the event, then widen the start by a booking lead time. Paired with the type filter, that wide window costs nothing — the newsletters advertising cinema tickets are typed newsletter and never appear.
Mail analyzed before classification existed carries no type; if a type filter comes back empty, fall back to a free-text query.
Search by sender and text
from matches a substring of the sender’s name or address; query is free-text over subject, body, and addresses — terms are OR’d, so a message matches if it contains any of them, and messages matching more terms rank first (quote a phrase to require all its words in the same field). They compose:
Prompt
Tool call — search_emails
Read the full message
Search results are deliberately body-free to stay light on tokens. The agent opens a specific hit by id:Tool call — get_email
Result
Follow a conversation
Given any message id,get_thread returns the whole conversation oldest-first, so the agent can reconstruct context before answering:
Tool call — get_thread
Result
Clear the inbox
Once a conversation is handled, the agent can file it. Every idget_thread listed goes into one call, and the outcome is reported per id:
Tool call — archive_emails
Result
archive_emails clears the inbox, move_emails files into a named folder, and trash_emails — the only one annotated as destructive — deletes. None of them creates a folder or changes a flag — read state, to-dos and stars stay as they were.
Reading doesn’t mark anything read either. When the user wants handled mail to look handled, the agent says so with mark_emails. The same tool sets and clears the to-do flag, so finishing a to-do is one call before the archive:
Tool call — mark_emails
Result