Skip to main content
Glama

mail_unjunk

Moves Junk copies of given message IDs back to the account's Inbox on IMAP servers, re-checking Message-ID and optional sender name before each move. Nothing is deleted or sent; dry_run previews.

Instructions

Move the Junk copies of messages (message_ids, e.g. from mail_find with mailboxes ['junk']) to that account's Inbox, on the server for IMAP accounts. Copies in any other mailbox are never touched; nothing is deleted, marked or sent. Each copy's Message-ID is re-checked before it moves, and with from_name_contains the sender's display name must still contain that text (any case) or the copy stays in Junk. Not destructive, so no confirm is needed; dry_run previews. A call stops starting new moves after ~35s and reports 'remaining'; run it again for the rest.

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": {
      "message_ids": "<message_ids>"
    },
    "name": "mail_unjunk"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoRequired for deletes and multi-recipient sends; without it the call only previews
dry_runNoPreview only: report what would happen and change nothing (default false)
message_idsYesRFC822 Message-IDs (up to 500). Only their Junk copies move.
from_name_containsNoOptional guard: move a copy only if its sender's display name still contains this text (case-insensitive)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.4.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it declares the operation non-destructive, explains that no confirm is required, documents the ~35s time cap and the 'remaining' continuation pattern, and notes the per-copy Message-ID re-check plus the from_name_contains guard. These are exactly the execution traits an agent cannot infer from the schema.

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?

The primary action is front-loaded in the first clause, and each following sentence adds a distinct operational fact (scope, safety, guard, timeout) with no filler. Parenthetical examples are used efficiently rather than as padding.

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 4-parameter mutation tool with no annotations and no output schema, the description covers scope, safety, guards, and timeout behavior well. The only gap is that it does not describe the response shape beyond the 'remaining' field, which the absence of an output schema leaves undocumented.

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 baseline is 3, but the description adds real meaning: from_name_contains is described as a case-insensitive guard that can keep a copy in Junk, message_ids are constrained to Junk copies only, and dry_run/confirm behavior is clarified relative to the schema's generic 'confirm' wording. It does not document the cap of 500 ids itself, but that lives in the schema.

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 opens with a specific verb and resource ('Move the Junk copies of messages ... to that account's Inbox') and immediately scopes it ('on the server for IMAP accounts'). It also rules out adjacent behaviors ('nothing is deleted, marked or sent'), which separates it from siblings like mail_trash and mail_mark.

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?

It gives clear usage context, including how to source the ids ('e.g. from mail_find with mailboxes ["junk"]') and when to use dry_run. It stops short of naming an explicit alternative tool or stating when another tool would be the better choice, so it is clear context without full routing guidance.

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