Skip to main content
Glama
SinoEdwards

Mail Agent MCP

by SinoEdwards

imap_remove_keyword

Remove a custom IMAP keyword or label from an email by UID, passing the keyword verbatim. Rejects system flags like \Flagged; use dedicated tools for those.

Instructions

Remove an arbitrary custom (non-system) IMAP keyword/label from an email — e.g. a provider color label like Open-Xchange's $cl_1..$cl_10, Apple Mail's $MailFlagBit0..$MailFlagBit2, or an app tag such as $promotion. Unlike imap_unflag_email (which only ever clears the system \Flagged flag), this passes the keyword through verbatim, but rejects backslash-prefixed system flags (e.g. \Flagged, \Seen, \Deleted) — use the dedicated flag/read tools for those. Not every IMAP server permits custom keywords (see the mailbox's PERMANENTFLAGS) — if the server rejects or silently ignores the change, this call fails rather than reporting success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesEmail UID
folderNoFolder nameINBOX
keywordYesIMAP keyword to remove, passed through verbatim (e.g. "$cl_3", "$MailFlagBit0", "$Junk")
accountIdNoAccount ID (from imap_list_accounts). Optional if accountName is given or only one account is configured.
accountNameNoAccount name instead of accountId. Optional if accountId is given or only one account is configured.
Install Server

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full disclosure burden. It covers verbatim pass-through of the keyword, rejection of backslash-prefixed system flags, and the authenticity of failure rather than false success when the server disallows custom keywords. This is exactly the behavioral context an agent needs to predict outcomes.

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?

Three sentences, each packed with necessary information, with no filler. The action is up front and the distinguishing/trade-off information follows naturally. The length is justified by the complexity of custom-keyword behavior.

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?

The definition covers purpose, alternatives, input nuances, server-dependent behavior, and failure semantics, all in one passage. Even without an output schema, an agent knows what to expect: success or a failure rather than silent no-op. Complete for a tool of this complexity.

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. The description adds value beyond the schema for the 'keyword' parameter by showing valid formats and clarifying that it is passed verbatim. It doesn't need to re-expl relatin uid/folder/account becaus they are already well described 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: 'Remove an arbitrary custom (non-system) IMAP keyword/label from an email.' It then provides concrete examples ($cl_1, $MailFlagBit0, $promotion) and immediately differentiates itself from imap_unflag_email, which clears only the system \Flagged flag. No ambiguity remains about what this tool 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?

The description explicitly contrasts with imap_unflag_email ('only ever clears the system \Flagged flag') and tells the agent to use dedicated flag/read tools for system flags like \Flagged, \Seen, \Deleted. It also warns that custom keywords depend on server PERMANTFLAGS and that the call fails if the server rejects the change. This gives clear when-to-use and when-not-to-use guidance.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SinoEdwards/mail-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server