search_emails
Search email conversations sent to or received from a contact or account. Filter by contact email, company domain, keyword in subject/body, or sent/inbox direction. When checking emails across multiple topics, terms, or people, pass them all via keywords (up to 10) in a single call - do not loop with multiple search_emails calls. Searches across all mailboxes the user can access, including their own Gmail and any shared mailboxes delegated to them. Each result includes mailbox_email and is_shared so you can tell which inbox an email came from. Pass mailbox_id to restrict to a specific mailbox. A domain/email-only miss triggers a real-time Gmail sync. If only a different workspace member has a match, privacy-safe fallback fields expose activity or Gmail email subjects through workspace_email_subjects only; never claim access to the hidden message details or mailbox owner. Use when asked about email history, correspondence, what was emailed, communication with a lead or account, or "did I email them." DEAL CAPTURE: If emails you can read with an outside company show buying interest (a pricing question, a trial, a proposal, a request to talk), run search_deals with account_name set to that company, any stage (if only an email domain is known, search its root name). If the company has no open deal (won or lost stages are closed), offer once per company per conversation to create one with create_deal, proposing a pipeline from list_pipelines, the company domain and the main external contact's email. Create it only after the user agrees. Never judge from workspace_email_subjects. Skip when the user has declined or a saved rule turns deal suggestions off.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_emails"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Filter by sent/inbox/all | all |
| limit | No | ||
| keywords | No | Multi-keyword OR search - pass up to 10 terms and any email matching at least one term in subject, snippet, or body is returned. Use instead of search_query when searching for emails mentioning any of several topics. | |
| mailbox_id | No | Optional: restrict the search to a single Gmail mailbox id. Defaults to all mailboxes the user can access (their own plus any shared mailboxes delegated to them). | |
| session_id | No | The ID of the task this call belongs to. Leave it out on your first call. On every later call for the same task, send the ID an earlier result gave you, and pass it to any subagent working on that task. | |
| search_query | No | Search by email subject or content | |
| contact_email | No | Search emails involving this exact address. On a mailbox miss, Gmail is synchronized in real time. | |
| account_domain | No | Search emails involving this company domain. On a mailbox miss, CRM contacts at the domain are synchronized from Gmail one at a time. |