[FEAT/Batch] Add batch email operations with filter support and batch_archive#61
Merged
Conversation
- searchByFilter: resolve UIDs via IMAP SEARCH from a structured filter (from, subject, before, after, read) - batchMoveEmails / batchDeleteEmails / batchMarkEmails: single IMAP command per operation using UID sequence sets instead of N round-trips - findArchiveFolder: detect Archive mailbox via \Archive special-use flag then fallback to common name patterns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Batch handlers (batch_move, batch_delete, batch_mark) now accept either explicit `uids` or a structured `filter` resolved via IMAP SEARCH - 500-uid hard limit per call; exceeding it throws with a clear message - New batch_archive handler: auto-detects Archive folder via findArchiveFolder, then moves matching emails in a single IMAP command - Update mock pool to handle UID set strings for batch assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add batch_archive tool (auto-detects Archive folder) - Update batch_move, batch_delete, batch_mark schemas: uids is now optional and accepts an optional filter object (from, subject, before, after, read) - Max 500 UIDs enforced at handler level; MCP schema stays open for filter path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- batchMove/Delete/Mark: test filter-based uid resolution via IMAP SEARCH - batch uid limit: verify 501 throws, 500 is accepted - missing input: verify error when neither uids nor filter provided - batchArchive: archive via explicit uids, via filter, and no-archive-folder error - Update mock pool to expose archiveFolder option and handle list() for findArchiveFolder detection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
elydelva
marked this pull request as ready for review
March 28, 2026 01:08
list all available mcp tools grouped by category: account management, reading & searching, sending, single-email actions, and batch actions. add batch_archive and filter examples to the batch section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements ADR-016: adds MCP tools for batch email operations (delete, move, mark, archive) capable of processing up to 500 emails in a single call, with optional server-side filter resolution via IMAP SEARCH.
Closes #60
Related ADR
ADR-016
Notable changes
"1,2,3") tomessageMove/messageDelete/messageFlagsAddinstead of N sequential calls — significant latency reduction for large batches.filterobject (from,subject,before,after,read) instead of explicit UIDs; the server resolves matching UIDs via IMAP SEARCH before executing the operation.batch_archive: new tool that auto-detects the Archive folder via\Archivespecial-use flag (with fallback to name patterns) then moves in one command.Checklist
pr,pr_url,status)docs/adr/README.mdstatus column updatedReview notes
batch_archivethrows if no Archive folder is detected; callers should uselist_foldersfirst if unsure.