Skip to main content
Glama

Mark emails as junk

mark_junk
Destructive

Move messages into the junk folder, which is what "report spam" does in a mail client. The move is not just filing: mail servers learn from their own junk folder, so this is also what teaches the filter to catch the next one - on Microsoft 365, on Gmail, and on any IMAP host running spam training. The junk folder is resolved by the ROLE the server gives it rather than by name, because it is called "Junk Email" on Microsoft 365, "[Gmail]/Spam" on Gmail and "Junk" on most IMAP hosts. IF THIS MAILBOX HAS NO JUNK FOLDER, ONE IS CREATED, and subscribed so it shows up in Outlook and Roundcube; the reply says so. REFUSES messages that are already in the junk folder. All the messages must be in the SAME source folder. Flags and the original dates are preserved. not_junk reverses this. Pass every UID in one call rather than calling it once per message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidsYesThe UIDs to act on, from list_emails, search_emails or select_emails. Pass EVERY message you want changed in ONE call - this tool acts on the whole set in a single operation, and doing it that way costs the user one call instead of one per message. Up to 500 at a time. A single message is simply a one-element array.
mailboxNoThe folder the messages are in now. Defaults to INBOX.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / uids / description
      Previous value: -"The UIDs to act on, from list_emails or search_emails. Pass EVERY message you want changed in ONE call - this tool acts on the whole set in a single operation, and doing it that way costs the user one call instead of one per message. Up to 500 at a time. A single message is simply a one-element array."New value: +"The UIDs to act on, from list_emails, search_emails or select_emails. Pass EVERY message you want changed in ONE call - this tool acts on the whole set in a single operation, and doing it that way costs the user one call instead of one per message. Up to 500 at a time. A single message is simply a one-element array."
  2. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only supply the generic safety profile (destructive, non-idempotent, not read-only); the description adds real behavior the annotations cannot convey: it creates and subscribes a junk folder when absent, refuses already-junked messages, preserves flags and original dates, requires a single source folder, and triggers server-side spam training. It does not describe response payload shape beyond 'the reply says so', but the behavioral disclosure is well above the annotation baseline.

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 purpose, then constraints, then the sibling pointer — a sensible order. It is on the long side and leans on all-caps emphasis for the folder-creation behavior, which is slightly noisy, but each sentence carries distinct 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 a destructive, side-effectful batch operation with no output schema, the description covers the essentials: folder resolution by role across M365/Gmail/IMAP, creation-if-missing with subscription, refusal semantics, preservation guarantees, and batching. An agent has everything needed to call it safely and correctly.

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%, so both parameters are already documented, including the batching guidance the description repeats verbatim in its final sentence. The description's only genuine addition is the same-source-folder constraint, which touches the mailbox parameter but is framed behaviorally rather than as parameter syntax, so the baseline 3 holds.

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+resource ('Move messages into the junk folder') and anchors it to a familiar mental model ('what "report spam" does in a mail client'), which cleanly separates it from siblings like move_email. It also names not_junk as the inverse, so an agent can route correctly 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?

Explicit when-to-use (spam reporting / filter training), when-not (messages already in the junk folder are refused), an alternative (not_junk reverses this), and an operational constraint (all messages must share one source folder, batch UIDs in one call). Nothing important is left to inference.

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.

Resources