Skip to main content
Glama

Octolane

search_emails

Idempotent

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

NameRequiredDescriptionDefault
labelNoFilter by sent/inbox/allall
limitNo
keywordsNoMulti-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_idNoOptional: 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_idNoThe 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_queryNoSearch by email subject or content
contact_emailNoSearch emails involving this exact address. On a mailbox miss, Gmail is synchronized in real time.
account_domainNoSearch emails involving this company domain. On a mailbox miss, CRM contacts at the domain are synchronized from Gmail one at a time.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: it discloses that searches span all accessible mailboxes including delegated shared ones, that a domain/email-only miss triggers a real-time Gmail sync (consistent with readOnlyHint=false), and that cross-workspace matches surface only privacy-safe fallback fields. It also names the returned fields (`mailbox_email`, `is_shared`) and warns never to claim access to hidden message details or mailbox owners.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The search behavior and the multi-keyword batching rule are correctly front-loaded, and the uppercase DEAL CAPTURE marker makes the tangent scannable. However, that deal-capture block runs nearly as long as the description of the tool itself and describes another tool's workflow, which is disproportionate for a search endpoint.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter, no-output-schema tool, the description covers scope, mailbox resolution, fallback behavior, and even the shape of key return fields, so an agent can call it and interpret results without guessing. The only unaddressed item, `session_id`, is documented in the schema itself.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 88%, so the baseline is 3, but the description adds operational meaning: `keywords` is a batched OR search of up to 10 terms that replaces repeated calls, and `mailbox_id` narrows scope that otherwise defaults to all accessible mailboxes. It adds less to `label`, `limit`, and `session_id`, which are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Search email conversations sent to or received from a contact or account') and enumerates the filter axes: contact email, company domain, keyword in subject/body, and sent/inbox direction. It is clearly distinguishable from siblings like search_deals or search_contacts, which are referenced only as downstream follow-ups.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit trigger phrasing ('Use when asked about email history, correspondence, what was emailed...'), an explicit anti-pattern ('do not loop with multiple search_emails calls'), and an in-tool alternative rule (use `keywords` instead of `search_query` for multi-topic searches). It also spells out the conditional handoff to `search_deals`, `list_pipelines`, and `create_deal`, including the skip conditions (user declined, saved rule turns suggestions off).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources