Skip to main content
Glama
outlook-mcp

outlook-mcp

by ajs117

bulk_by_query

Apply one action—archive, delete, mark read/unread, or move—to every matching email in a single call, with a dry-run preview to prevent accidental mass changes.

Instructions

Find every message matching a query and apply one action to all of them in a single call — the message ids never enter the conversation, so this is by far the cheapest way to triage in bulk.

action: one of archive, delete, mark_read, mark_unread, move (move requires destination_folder, which may be a folder display name). folder / filter_query / search: same matching semantics as list_messages (fetches all matches up to max_results). received_before / received_after: ISO dates (e.g. "2026-01-01"); applied client-side AFTER matching, so they compose with search — which Graph itself won't combine with a date $filter. Use these for "old " sweeps, e.g. search="delivery" + received_before to clear old shipping mail. only_newsletters: keep only bulk/newsletter mail (messages with a List-Unsubscribe header) among the matches, e.g. archive all newsletters older than a week. Costs an extra batched header pass over the matches. Note this is a bulk-sender signal, not a junk one — plenty of wanted mail (order updates, voucher codes, statements) carries the header too. senders_only: keep only matches from these sending addresses (exact, case-insensitive). Graph rejects a sender $filter combined with $orderby, so this is applied client-side — it is the supported way to act per sender. Pair it with sender_summary to pick the addresses. on_protected: what to do about matches from protected senders (see protected_senders): "exclude" (default, skip them and report), "error" (do nothing at all and report), "include" (ignore the list). dry_run: TRUE by default — returns how many messages would be affected plus a small sample of subjects/senders, and does nothing. Review it, then call again with dry_run=False to actually run the action. This guards against a bad filter nuking the wrong mail.

Input Schema

NameRequiredDescriptionDefault
actionYes
folderNoinbox
searchNo
dry_runNo
max_resultsNo
filter_queryNo
on_protectedNoexclude
senders_onlyNo
received_afterNo
received_beforeNo
only_newslettersNo
destination_folderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it discloses that dry_run is TRUE by default and what it returns, that on_protected skips protected senders by default, that date/sender filters are applied client-side, and that only_newsletters costs an extra header pass. It stops short of stating whether delete is permanent or recoverable and what the final report looks like.

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?

Long but front-loaded and organized as one labeled block per parameter, so an agent can skim to the field it needs. A few parenthetical asides (the 'old <topic>' sweep example, the newsletter-vs-junk lecture) run longer than strictly necessary, but nothing is wasted filler.

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 12-parameter, no-annotation, no-output-schema mutation tool this is close to complete: safety defaults, filtering composition rules, and protected-sender behavior are all covered. The remaining gaps are max_results truncation behavior and the shape of the non-dry-run result.

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 description coverage is 0%, so the description must compensate for all 12 parameters, and it explains roughly ten of them including the undocumented-in-schema action enum values and the destination_folder requirement for move. max_results is only mentioned in passing as an upper bound with no default or truncation semantics, and folder's default of inbox is left implicit.

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 — find every message matching a query and apply one action to all of them in a single call — plus the distinguishing benefit (ids never enter the conversation). It is clearly the general filter-driven counterpart to the action-specific siblings (bulk_archive_messages, bulk_move_messages, etc.).

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 prescribes the dry_run-then-rerun workflow, spells out the on_protected policy choices, and tells the agent when to prefer received_before/after over a Graph date $filter and when to use senders_only instead of a sender $filter. It even routes the agent to sender_summary for picking addresses.

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