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. Use not_junk to reverse 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 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.
mailboxNoThe folder the messages are in now. Defaults to INBOX.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

With annotations already signaling destructive/read-only false, the description adds substantial behavioral detail: the junk folder is role-resolved across providers, a junk folder is created if missing, already-junk messages are refused, flags and original dates are preserved, and the server learns from the move. This exceeds what the annotations and schema provide.

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?

The description is longer than average but every sentence carries useful operational or provider-specific information. It is front-loaded with the core meaning ('report spam') and then builds toward constraints and edge cases. Some capitalization is stylistically noisy, but content justifies the length.

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 mutation with no output schema, the description covers the essential behaviors: what the operation does, how the junk folder is resolved, what happens when no junk folder exists, refusal conditions, preservation of flags and dates, and batch-calling guidance. An agent has enough context to invoke it correctly without additional assumptions.

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 adds meaning beyond the schema, particularly the requirement that all UIDs come from the same source folder and the emphasis on passing all UIDs in one call. It also clarifies how the mailbox parameter relates to the current folder of the messages.

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?

The description states a specific action (move messages into the junk folder), ties it to the familiar 'report spam' concept, and clarifies that it is not merely filing but also trains the spam filter. It clearly distinguishes this from the sibling not_junk by explicitly naming it as the reverse operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives strong contextual guidance: use this to report spam, and use not_junk to reverse it. It also instructs the agent to pass all UIDs in a single call and notes that all messages must be in the same source folder. It does not explicitly compare against move_email, but the spam-training semantics make the intended use clear enough.

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