Skip to main content
Glama

MCPEmails

Search and Move

email_search_and_move
DestructiveIdempotent

Move every message matching a search into a destination folder, in one server-side operation, so no message ID is ever stale by the time it is used. Search uses structured, provider-agnostic fields (from, to, cc, subject, body, text, unread, has_attachment, flagged, since, before) that the server translates into the inbox's native search syntax, so you never need provider query syntax; query is a raw escape hatch. SEPARATE from email_organize, and flagged destructive to your MCP client, because it acts on everything the filter matches rather than on ids you chose: one wrong filter relocates a whole inbox. email_organize (action 'move' or 'move_batch') is for messages already listed by id. Bounded by limit, maximum and default 500: has_more: true means matches were left behind, and email_organize (action 'move_batch') takes the remainder. On Gmail, moving adds the destination label and removes the INBOX label. Returns succeeded/failed counts and per-message results. Needs manage:folders.

Input Schema

NameRequiredDescriptionDefault
ccNoCc recipient to match: address, name, or fragment.
toNoTo recipient to match: address, name, or fragment.
bodyNoText to find in the body. On Gmail this matches the whole message.
fromNoSender to match: address, name, or fragment.
textNoText to match anywhere, headers included.
inboxNoInbox email address, an alternative to inbox_id.
limitNoCap on messages moved. Default 500.
queryNoProvider-native raw query (escape hatch); prefer the structured fields. Ignored on Fastmail.
sinceNoReceived on or after this date or datetime (no timezone = UTC). Also takes "2026-06", "today", "7 days ago", "last month" or "30d".
beforeNoReceived strictly before this date or datetime (no timezone = UTC). Takes the same relative forms as `since`.
unreadNotrue = unread only; false = read only; omit for both.
flaggedNotrue = only flagged/starred messages.
subjectNoText to match in the subject, as written. Gmail (API or IMAP) and Outlook match WHOLE WORDS, so a partial word finds nothing; other IMAP servers substring-match.
inbox_idNoInbox UUID (inbox_list). Optional with one inbox.
has_attachmentNotrue = only messages with an attachment. Ignored on generic IMAP.
idempotency_keyNoRetry key: reuse only for the identical call within 24h; it runs once.
include_foldersNoFolders to search, each a folder or label name or id from folder_list, or an alias (works where the mailbox has that role). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it.
destination_folder_idYesTarget folder: an alias (inbox, sent, drafts, trash, archive, spam), a folder name, or a folder id. Names and aliases resolve for you.

Output Schema

NameRequiredDescriptionDefault
limitNoThe limit that bounded the search.
notesNoServer notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCPEmails, not taken from any message, and absent when there is nothing to report.
failedYes
partialNoTrue when the operation did NOT process every message it was given. succeeded/failed describe only what was attempted; remaining_message_ids lists what was left untouched.
resultsYes
has_moreNoTrue when messages matching the query were left untouched because of the limit; the sweep is complete only when it is false.
inbox_idYes
operationYes
remainingNo
succeededYes
match_countNoHow many messages the search returned, i.e. the most this call could act on.
continuationNo
limit_noticeNoPresent only when has_more: plain-language statement of what was left behind.
limit_reachedNoTrue when the search filled its window and stopped counting. On its own it does not prove more mail exists; has_more is that claim.
total_matchesNoProvider's total match count when it supplies one.
partial_noticeNo
stopped_reasonNo'cancelled' — a person stopped the run from the dashboard. 'time_budget' — the server stopped on its own wall-clock limit so the result could be returned before the client timed out. Neither is an error.
total_requestedNo
remaining_message_idsNoMessages that were NOT processed and are unchanged. These exact ids, not a repeat of the original search, are what a follow-up call should use.
total_matches_is_estimateNoTrue when total_matches is a provider estimate (Gmail) rather than a count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / has_more / description
      Previous value: -"True when messages matching the query were left UNTOUCHED because of the limit. Check this before reporting the sweep complete: re-run until it is false."New value: +"True when messages matching the query were left untouched because of the limit; the sweep is complete only when it is false."
  2. Changed1 schema field changed
    • changedOutput schema / properties / notes / description
      Previous value: -"Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCP Emails, not taken from any message, and absent when there is nothing to report."New value: +"Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCPEmails, not taken from any message, and absent when there is nothing to report."
  3. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Reuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected."New value: +"Retry key: reuse only for the identical call within 24h; it runs once."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both — a pair naming different mailboxes is refused."New value: +"Inbox UUID (inbox_list). Optional with one inbox."
  4. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."New value: +"Folders to search, each a folder or label name or id from folder_list, or an alias (works where the mailbox has that role). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."
  5. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook always search everything."New value: +"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook search every folder except the trash (Deleted Items on Outlook; Gmail also skips Spam), so name it to include it."
  6. Changed2 schema fields changed
    • changedInput schema / properties / flagged / description
      Previous value: -"true = only flagged/starred messages. Ignored on Outlook."New value: +"true = only flagged/starred messages."
    • addedOutput schema / properties / results / items / properties / new_message_id
      Added value: +{
      +  "description": "Moves only: the message's id in the destination folder, to use for any further action on it. Omitted when the id did not change or was not reported.",
      +  "type": "string"
      +}
  7. Changed4 schema fields changed
    • changedInput schema / properties / before / description
      Previous value: -"Received strictly before this date or datetime (no timezone = UTC)."New value: +"Received strictly before this date or datetime (no timezone = UTC). Takes the same relative forms as `since`."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both."New value: +"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both — a pair naming different mailboxes is refused."
    • changedInput schema / properties / since / description
      Previous value: -"Received on or after this date or datetime (no timezone = UTC)."New value: +"Received on or after this date or datetime (no timezone = UTC). Also takes \"2026-06\", \"today\", \"7 days ago\", \"last month\" or \"30d\"."
    • changedInput schema / properties / subject / description
      Previous value: -"Text to match in the subject; phrases match as-is."New value: +"Text to match in the subject, as written. Gmail (API or IMAP) and Outlook match WHOLE WORDS, so a partial word finds nothing; other IMAP servers substring-match."
  8. Changed1 schema field changed
    • changedInput schema / properties / include_folders / description
      Previous value: -"Folder names to search. IMAP covers INBOX only when omitted."New value: +"Folders to search, each an alias, a folder or label name, or a folder id (names and aliases resolve for you). IMAP covers INBOX only unless you name archive or sent folders; Gmail and Outlook always search everything."
  9. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover destructive/idempotent/readOnly, but the description adds real value beyond them: server-side atomicity so no id goes stale, the Gmail label add/remove semantics, the 500 default cap with has_more signaling leftovers, the required manage:folders permission, and the return shape. It does not spell out partial-failure behavior beyond 'succeeded/failed counts', which keeps it short of a 5.

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

Conciseness4/5

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

Front-loaded with the core action and scope, then the risk warning, then the routing alternative and limits. It is dense and mostly earns its length, though the parenthetical field list and the Gmail label detail could be trimmed slightly without losing selection-critical information.

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 18-parameter destructive bulk mutation this covers the essentials: what is affected, permission requirement, truncation behavior, continuation route, and platform-specific move semantics. The output schema handles return values, so the brief mention of counts is sufficient.

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 100%, so the baseline is 3; the description still adds framing by characterizing the structured search fields as provider-agnostic and translated server-side, and by labeling `query` a raw escape hatch. It also ties `limit` to the has_more continuation behavior, which is semantic context the schema's per-property text does not state.

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 plus the key mechanism ('Move every message matching a search into a destination folder, in one server-side operation'), and immediately contrasts itself with email_organize by noting it acts on filters rather than chosen ids. An agent can distinguish it from every sibling without opening a schema.

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?

Explicitly names the alternative (email_organize with 'move' or 'move_batch') and the condition that selects each: this tool for filter-matched bulk moves, email_organize for messages already listed by id. It also explains the follow-up path when has_more is true, giving a complete selection and continuation rule.

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.