Skip to main content
Glama

imap_search_and_move

Search IMAP messages by sender, subject, date, or query and move matches to a destination mailbox in one call, up to 500 emails.

Instructions

Search messages and move matches to a mailbox in one operation (up to 500)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mailbox": "<mailbox>",
      "destination_mailbox": "<destination_mailbox>"
    },
    "name": "imap_search_and_move"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoFilter by To header
fromNoFilter by From header
limitNoMaximum messages to move (1..500, default 500)
queryNoFull-text search query
mailboxYesSource mailbox to search (e.g., `INBOX`)
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
destination_mailboxYesDestination mailbox name

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. First observedv0.4.12

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, so the safety profile is covered structurally. The description adds value by stating the 500-message cap, but leaves key behavior unstated: what happens to matches beyond 500, whether partial moves roll back, and that messages are removed from the source mailbox.

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?

A single front-loaded sentence with no filler; the action comes first and the constraint is parenthesized. It is efficiently written, though arguably too terse for a 12-parameter mutation tool.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the schema fully documents inputs. However, for an open-world, non-idempotent mutation tool the definition says nothing about failure modes, the 500-match overflow case, or source-mailbox side effects, which leaves the agent under-informed relative to the tool's complexity.

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% across all 12 parameters, so the schema carries the full burden of documenting filters, date formats and mailbox names. The description only restates the 500 cap that already appears in the limit field, adding no meaning beyond the schema.

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?

The description names a specific compound action (search + move) with a named destination resource, and 'in one operation' implicitly distinguishes it from the two-step search-then-bulk-move siblings. It stops short of naming imap_search_messages or imap_bulk_move as the alternatives, so differentiation is inferred rather than stated.

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?

Usage is only implied: the agent can infer this is the right tool when it already knows it wants to search and move together. There is no explicit guidance on when to prefer imap_search_messages followed by imap_bulk_move, nor any prerequisite or exclusion (e.g., cross-account moves).

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