Skip to main content
Glama
Mail-MCP

Mail-MCP

by Rixtayz

Bulk action by sender

mail_bulk_by_sender
DestructiveIdempotent

Move or delete every message from one exact sender in a folder, up to 5,000 per call, with a dry-run count first so you can confirm before anything changes.

Instructions

Move EVERY message from a sender (exact address) in a folder (Inbox by default) to another folder, or to Deleted Items, at most 5,000 per call. A dry run by default: it only counts the messages it would act on (matched) and changes nothing. Tell the user that count and, once they confirm, call again with dryRun: false. capped: true means the sender has more than 5,000 messages there: call again for the rest. Never deletes permanently (see mail_purge).

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": {
      "from": "<from>",
      "action": "<action>"
    },
    "name": "mail_bulk_by_sender"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromYesExact sender address
actionYesmove = move to targetFolder; delete = move to Deleted Items
dryRunNoDefault true: count only, change nothing. false = act, once the user has confirmed.
folderNoSource folder. Default: inbox
targetFolderNoRequired when action = move

Output Schema

NameRequiredDescriptionDefault
movedNo
cappedYestrue when the sender has more than 5,000 messages in the folder
dryRunYes
failedYes
matchedYesMessages acted on, or that would be with a dry run (at most 5,000)
succeededYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.2.2
    • changedInput schema / properties / action / description
      Previous value: -"move = move to targetFolder; delete = delete"New value: +"move = move to targetFolder; delete = move to Deleted Items"
    • changedInput schema / properties / dryRun / default
      Previous value: -falseNew value: +true
    • changedInput schema / properties / dryRun / description
      Previous value: -"true = count only, change nothing"New value: +"Default true: count only, change nothing. false = act, once the user has confirmed."
    • changedInput schema / properties / from / pattern
      Previous value: -"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"New value: +"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    • removedInput schema / properties / permanent
      Removed value: -{
      -  "default": false,
      -  "description": "With action = delete: permanent deletion",
      -  "type": "boolean"
      -}
    • addedOutput schema / properties / capped
      Added value: +{
      +  "description": "true when the sender has more than 5,000 messages in the folder",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / matched / description
      Added value: +"Messages acted on, or that would be with a dry run (at most 5,000)"
    • addedOutput schema / properties / moved
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "id": {
      +        "type": "string"
      +      },
      +      "newId": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "newId"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "matched",
      -  "dryRun",
      -  "succeeded",
      -  "failed"
      -]New value: +[
      +  "matched",
      +  "capped",
      +  "dryRun",
      +  "succeeded",
      +  "failed"
      +]
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, but the description adds the non-obvious traits: nothing is mutated on a default call, work is capped at 5,000 messages per call with a `capped` signal for the remainder, and deletion is only to Deleted Items. That is meaningful behavior beyond the safety hints.

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?

Front-loaded with the core action and cap, then the dry-run protocol, then the cap-handling rule, then the safety caveat. Every sentence carries operational content; there is no restatement of the name or filler.

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 a destructive, batched mutation with 5 parameters, the description covers the default-safe path, the confirmation loop, the cap and its continuation, and the relationship to permanent deletion. An output schema exists, yet the description's mention of `matched` and `capped` maps directly to the workflow it prescribes.

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 value by framing `dryRun` as a confirmation-gated switch and by clarifying that `targetFolder` matters only for action=move while delete routes to Deleted Items, tightening how the parameters should be combined.

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 with scope: move EVERY message from an exact sender address out of a source folder into a target folder or Deleted Items, capped at 5,000. It also distinguishes itself from mail_purge by noting it never deletes permanently, so an agent can separate it from the sibling that does.

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?

Gives an explicit operating protocol: dry run is the default, report the `matched` count to the user, and only re-call with `dryRun: false` after confirmation. It also covers the continuation case (`capped: true` → call again) and names mail_purge as the alternative for permanent deletion.

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