Skip to main content
Glama

Flag emails

flag_email
Idempotent

Flag messages - the same star/flag marker Outlook and webmail show, and the state search_emails's flagged filter finds. Purely a marker for the user's own attention; it does not move, read, or otherwise change the messages, and it does not mark anything read. Pass the whole set in ONE call. Verified rather than assumed: the flags are read back off the server, so a message that could not be changed is named individually instead of being folded into a success. A uid only means something in the folder it came from, so pass mailbox when the uids did not come from INBOX. Flagging a message that is already flagged changes nothing and is not an error. unflag_email clears it, and is the more dangerous half of the pair.

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.
mailboxNoIMAP folder name. Defaults to INBOX.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false), the description adds operational details: it's purely a marker, doesn't mark as read, verifies flag changes by reading back from the server, and names individual failures. This exceeds the annotation coverage.

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 description is dense but each sentence contributes unique operational or safety information. It is well-structured, starting with what the tool does, then what it doesn't do, then usage guidance, then verification and mailbox handling, then idempotency and sibling contrast. No unnecessary padding.

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 tool with no output schema, the description covers all essential usage aspects: batching, parameter semantics, side effects (it's a marker, doesn't change content), verification behavior, and how to handle edge cases (already flagged, non-INBOX uids). It also situates the tool among its siblings, making it fully self-contained for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers both parameters fully (uids array with limits and source context; mailbox with default). The description adds extra meaning about uids being tied to the originating folder and reinforces the batching intent, enriching the schema-provided semantics.

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 clearly states the tool flags messages (sets the star/flag marker) and explicitly distinguishes it from moving, reading, or altering content. It also references the sibling unflag_email, making the purpose unambiguous.

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?

It provides explicit batching guidance (pass the whole set in one call), explains when to include the mailbox parameter (when uids didn't come from INBOX), and clarifies idempotent behavior (already-flagged messages are not errors). It also differentiates the tool from unflag_email's more dangerous counterpart.

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