Skip to main content
Glama
Albretsen

MCP Emails

Organize Email

email_organize

Organize emails by message ID: move, copy, flag, or archive. For Gmail, moving to a label clears TRASH/SPAM, restoring messages. Use actions selectively to avoid relocating whole inboxes.

Instructions

Move, copy, flag or archive messages you name by message_id, in one inbox. Get message ids from email_read first. Every action acts only on the ids you pass and is undone by another call: a move by a move back, archive by a move into the Inbox, flag by the opposite flag, and a copy leaves the original untouched. On Gmail a move adds the destination label and removes INBOX, leaving other labels in place; moving a message OUT of Trash or Spam into a real label also clears TRASH/SPAM, so it is a genuine restore rather than a labelled message still queued for deletion. To move everything matching a search instead of a list of ids, use email_search_and_move, which is its own tool because a wrong filter there relocates a whole inbox. Needs manage:folders; deleting is the separate email_delete tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inboxNoInbox email address, an alternative to inbox_id.
actionYesOperation to run. move = one message_id to destination_folder_id; move_batch = the same for up to 500 message_ids; copy = duplicate into destination_folder_id, original stays, IMAP/Outlook/Fastmail only (never Gmail); copy_batch = the same for up to 500 message_ids; flag = set read/unread/flagged on message_ids via flag_action; archive = move one message_id out of the Inbox. Required: move_batch: destination_folder_id; copy: message_id; copy_batch: destination_folder_id.
inbox_idNoInbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both.
message_idNoProvider-native message id from a list or search.
flag_actionNoState to apply to every listed message; flag/unflag add or remove the star.
message_idsNoProvider-native message ids to move. Duplicates are removed, first occurrence kept, so succeeded counts distinct messages.
idempotency_keyNoReuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected.
destination_folder_idNoTarget folder: an alias (inbox, sent, drafts, trash, archive, spam), a folder name, or a folder id. Names and aliases resolve for you.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNoServer notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCP Emails, not taken from any message, and absent when there is nothing to report.
failedNo
has_moreNoTrue when messages matching the query were left UNTOUCHED because of the limit. Check this before reporting the sweep complete: re-run until it is false.
inbox_idNo
operationNo
succeededNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed22 schema fields changed
    • removedInput schema / allOf
      Removed value: -[
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "move"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_id",
      -        "destination_folder_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "move_batch"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_ids",
      -        "destination_folder_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "copy"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_id",
      -        "destination_folder_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "copy_batch"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_ids",
      -        "destination_folder_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "flag"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "destination_folder_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_ids",
      -        "flag_action"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "archive"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "destination_folder_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "from"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "to"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "cc"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "subject"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "body"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "text"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "unread"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "has_attachment"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flagged"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "since"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "before"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "query"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "include_folders"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "limit"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "message_id"
      -      ]
      -    }
      -  },
      -  {
      -    "if": {
      -      "properties": {
      -        "action": {
      -          "const": "search_and_move"
      -        }
      -      },
      -      "required": [
      -        "action"
      -      ]
      -    },
      -    "then": {
      -      "not": {
      -        "anyOf": [
      -          {
      -            "required": [
      -              "message_id"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "message_ids"
      -            ]
      -          },
      -          {
      -            "required": [
      -              "flag_action"
      -            ]
      -          }
      -        ]
      -      },
      -      "required": [
      -        "destination_folder_id"
      -      ]
      -    }
      -  }
      -]
    • changedInput schema / properties / action / description
      Previous value: -"Operation to run. move = one message_id to destination_folder_id; move_batch = the same for up to 500 message_ids; copy = duplicate into destination_folder_id, original stays, IMAP/Outlook/Fastmail only (never Gmail); copy_batch = the same for up to 500 message_ids; flag = set read/unread/flagged on message_ids via flag_action; archive = move one message_id out of the Inbox; search_and_move = move everything matching a search, the only action the search filters apply to."New value: +"Operation to run. move = one message_id to destination_folder_id; move_batch = the same for up to 500 message_ids; copy = duplicate into destination_folder_id, original stays, IMAP/Outlook/Fastmail only (never Gmail); copy_batch = the same for up to 500 message_ids; flag = set read/unread/flagged on message_ids via flag_action; archive = move one message_id out of the Inbox. Required: move_batch: destination_folder_id; copy: message_id; copy_batch: destination_folder_id."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "move",
      -  "move_batch",
      -  "copy",
      -  "copy_batch",
      -  "flag",
      -  "archive",
      -  "search_and_move"
      -]New value: +[
      +  "move",
      +  "move_batch",
      +  "copy",
      +  "copy_batch",
      +  "flag",
      +  "archive"
      +]
    • removedInput schema / properties / before
      Removed value: -{
      -  "description": "Received strictly before this date or datetime (no timezone = UTC).",
      -  "format": "date-or-date-time",
      -  "type": "string"
      -}
    • removedInput schema / properties / body
      Removed value: -{
      -  "description": "Text to find in the body. On Gmail this matches the whole message.",
      -  "type": "string"
      -}
    • removedInput schema / properties / cc
      Removed value: -{
      -  "description": "Cc recipient to match: address, name, or fragment.",
      -  "type": "string"
      -}
    • removedInput schema / properties / flagged
      Removed value: -{
      -  "description": "true = only flagged/starred messages. Ignored on Outlook.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / from
      Removed value: -{
      -  "description": "Sender to match: address, name, or fragment.",
      -  "type": "string"
      -}
    • removedInput schema / properties / has_attachment
      Removed value: -{
      -  "description": "true = only messages with an attachment. Ignored on generic IMAP.",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Opaque key for one operation, outbound or mailbox mutation. Reuse it only when retrying the identical request within 24 hours: the retry is collapsed, not repeated, which matters most for copy. Reuse with different arguments is rejected; omit it for normal behaviour."New value: +"Reuse only when retrying the identical request within 24 hours; the retry is collapsed, not repeated. Reuse with different arguments is rejected."
    • changedInput schema / properties / inbox / description
      Previous value: -"Inbox email address; an alternative to inbox_id, which wins when both are given."New value: +"Inbox email address, an alternative to inbox_id."
    • changedInput schema / properties / inbox_id / description
      Previous value: -"Inbox UUID. Optional when the key has exactly one inbox. Otherwise pass this or `inbox`; omit both and the error lists every inbox_id."New value: +"Inbox UUID from inbox_list. Optional when the key has one inbox; pass this or `inbox`, not both."
    • removedInput schema / properties / include_folders
      Removed value: -{
      -  "description": "Folder names to search. IMAP covers INBOX only when omitted.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / limit
      Removed value: -{
      -  "description": "Cap on messages moved. Default 500.",
      -  "maximum": 500,
      -  "minimum": 1,
      -  "type": "number"
      -}
    • changedInput schema / properties / message_ids / description
      Previous value: -"Provider-native message ids to move."New value: +"Provider-native message ids to move. Duplicates are removed, first occurrence kept, so succeeded counts distinct messages."
    • removedInput schema / properties / query
      Removed value: -{
      -  "description": "Provider-native raw query (escape hatch); prefer the structured fields. Ignored on Fastmail.",
      -  "type": "string"
      -}
    • removedInput schema / properties / since
      Removed value: -{
      -  "description": "Received on or after this date or datetime (no timezone = UTC).",
      -  "format": "date-or-date-time",
      -  "type": "string"
      -}
    • removedInput schema / properties / subject
      Removed value: -{
      -  "description": "Text to match in the subject; phrases match as-is.",
      -  "type": "string"
      -}
    • removedInput schema / properties / text
      Removed value: -{
      -  "description": "Text to match anywhere, headers included.",
      -  "type": "string"
      -}
    • removedInput schema / properties / to
      Removed value: -{
      -  "description": "To recipient to match: address, name, or fragment.",
      -  "type": "string"
      -}
    • removedInput schema / properties / unread
      Removed value: -{
      -  "description": "true = unread only; false = read only; omit for both.",
      -  "type": "boolean"
      -}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "failed": {
      +      "type": "integer"
      +    },
      +    "has_more": {
      +      "description": "True when messages matching the query were left UNTOUCHED because of the limit. Check this before reporting the sweep complete: re-run until it is false.",
      +      "type": "boolean"
      +    },
      +    "inbox_id": {
      +      "type": "string"
      +    },
      +    "notes": {
      +      "description": "Server notes about how this call was handled — for example an argument that was not applied because the selected action does not accept it. Written by MCP Emails, not taken from any message, and absent when there is nothing to report.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "operation": {
      +      "type": "string"
      +    },
      +    "succeeded": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv1.0.4

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say non-readOnly, non-destructive. The description goes well beyond: mutation is confined to passed ids, every action is reversible, Gmail labeling semantics (adds label, removes INBOX, clears TRASH/SPAM), and the manage:folders permission requirement. No contradiction with annotations.

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?

Dense but well-organized; core semantics first, then provider-specific caveats, then alternative tools. A couple of long sentences could be split, but every sentence earns its place.

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?

Covers prerequisites, per-operation semantics, provider differences, permissions, and explicit routing to sibling tools (email_read, email_search_and_move, email_delete). For an 8-parameter tool this is fully specified.

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%, but the description adds meaning beyond the enum names: copy leaves the original untouched, move_batch handles up to 500 ids, flag_action sets read/unread/flagged, archive moves out of Inbox, and message_ids come from email_read. This elevates it above schema-only baseline.

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 precise verb-resource pair: 'Move, copy, flag or archive messages you name by message_id, in one inbox.' It clearly distinguishes itself from email_search_and_move and email_delete by explicitly naming what it does not do and pointing to those alternatives.

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 says to get message ids from email_read first, tells the agent to use email_search_and_move when operating on a search instead of ids, and points to email_delete for deletion. This gives explicit when-to-use and when-not-to-use guidance with named alternatives.

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