Skip to main content
Glama

imap_search_all_mailboxes

Read-onlyIdempotent

Search every mailbox in an account in one call to locate messages or an entire conversation, returning newest-first results labeled by mailbox.

Instructions

Search every mailbox of an account in one call (e.g. a whole conversation via thread_message_id); results are newest first and labelled with their mailbox

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": "imap_search_all_mailboxes"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoFilter by To header
fromNoFilter by From header
limitNoMaximum messages to return, newest first across all mailboxes (1..200, default 50)
queryNoFull-text search query
subjectNoFilter by Subject header
end_dateNoFilter to messages before this date (YYYY-MM-DD)
last_daysNoFilter to messages from last N days
account_idNoAccount identifier (defaults to `"default"`)default
start_dateNoFilter to messages on or after this date (YYYY-MM-DD)
unread_onlyNoFilter to unread messages only
include_snippetNoInclude subject snippet in results
exclude_mailboxesNoSkip these mailboxes and their sub-mailboxes (exact names, e.g. `Junk`)
include_mailboxesNoOnly search these mailboxes and their sub-mailboxes (exact names)
snippet_max_charsNoMaximum snippet length (50..500, requires `include_snippet=true`)
thread_message_idNoFind a conversation by its RFC 5322 Message-ID (angle brackets optional): the message itself and every reply that references it, in any mailbox

Output Schema

NameRequiredDescriptionDefault
dataYesTool-specific data payload
metaYesExecution metadata (timestamp, duration)
summaryYesHuman-readable summary of the operation outcome

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv0.7.1
    • removedInput schema / description
      Removed value: -"Input: search every mailbox of an account\n\nUsed by `imap_search_all_mailboxes`. Takes the same criteria as\n`imap_search_messages` (at least one is required) and searches every\nselectable mailbox, optionally narrowed by name."
    • removedInput schema / properties / end_date / nullable
      Removed value: -true
    • changedInput schema / properties / end_date / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / exclude_mailboxes / nullable
      Removed value: -true
    • changedInput schema / properties / exclude_mailboxes / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • removedInput schema / properties / from / nullable
      Removed value: -true
    • changedInput schema / properties / from / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / include_mailboxes / nullable
      Removed value: -true
    • changedInput schema / properties / include_mailboxes / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • removedInput schema / properties / last_days / nullable
      Removed value: -true
    • changedInput schema / properties / last_days / type
      Previous value: -"integer"New value: +[
      +  "integer",
      +  "null"
      +]
    • removedInput schema / properties / query / nullable
      Removed value: -true
    • changedInput schema / properties / query / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / snippet_max_chars / nullable
      Removed value: -true
    • changedInput schema / properties / snippet_max_chars / type
      Previous value: -"integer"New value: +[
      +  "integer",
      +  "null"
      +]
    • removedInput schema / properties / start_date / nullable
      Removed value: -true
    • changedInput schema / properties / start_date / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / subject / nullable
      Removed value: -true
    • changedInput schema / properties / subject / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / thread_message_id / nullable
      Removed value: -true
    • changedInput schema / properties / thread_message_id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / to / nullable
      Removed value: -true
    • changedInput schema / properties / to / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / unread_only / nullable
      Removed value: -true
    • changedInput schema / properties / unread_only / type
      Previous value: -"boolean"New value: +[
      +  "boolean",
      +  "null"
      +]
    • removedInput schema / title
      Removed value: -"SearchAllMailboxesInput"
    • removedOutput schema / description
      Removed value: -"Standard response envelope for all tools\n\nWraps tool-specific data with human-readable summary and execution metadata.\nThis structure provides consistent response shape across all MCP tools."
    • removedOutput schema / title
      Removed value: -"ToolEnvelope"
  2. Addedv0.4.17

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds that results are newest-first and tagged with their mailbox, which is useful behavior beyond the annotations, but it says nothing about cross-account auth needs, cost of scanning all mailboxes, or pagination.

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

Conciseness5/5

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

A single front-loaded sentence with the scope stated first and execution/result details appended — zero filler and nothing buried.

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

Completeness4/5

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

For a 15-parameter, cross-mailbox search the description covers scope, the notable thread lookup case, and ordering; the output schema handles return values and the schema handles include/exclude_mailboxes interplay. Only minor gaps remain, such as no hint about result volume when scanning all mailboxes.

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

Parameters3/5

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

Schema description coverage is 100%, so all 15 parameters are already documented in the schema. The description only elaborates on thread_message_id semantics (whole conversation across mailboxes) and result ordering; with the schema doing the heavy lifting, this is the baseline adequate score.

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

Purpose4/5

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

It names a specific verb and scope: 'Search every mailbox of an account in one call', which clearly contrasts with a single-mailbox search. The thread_message_id example adds precision, but no sibling tool is named, so differentiation relies on inference from 'every mailbox'.

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

Usage Guidelines3/5

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

The parenthetical example ('a whole conversation via thread_message_id') implies a when-to-use scenario, but there is no explicit guidance on when to prefer this over imap_search_messages or ews_search_messages, and no exclusions or prerequisites.

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