Skip to main content
Glama

Cooper Email

Update thread labels

cooper_update_thread
Idempotent

Use this when every message in a conversation should gain or lose the same labels, including marking the thread read, or when the thread should move to inbox, archive, spam, or trash. Requires auth. Works on a paused inbox. Inputs: inbox_id (required; inbox id, username, or email), thread_id (required), add_labels (optional strings), remove_labels (optional strings), folder (optional; inbox, archive, spam, or trash), block_sender (optional boolean; only with folder spam). The label change is applied to every message in the thread. read and unread can be changed. Other system labels (inbox, sent, untrusted, auth_failed, owner, and SPF/DKIM/DMARC results) cannot. Moving to the same folder twice changes nothing and emits no event. Moving to inbox removes the folder row. Trash sets purge_after to 30 days after the move. block_sender adds the latest inbound From address to the inbox receive block list and returns blocked_sender. Returns the thread plus messages_updated, and blocked_sender when block_sender was true. The thread includes assignment, folder, and purge_after. Unknown thread returns HTTP 404 thread_not_found. Invalid labels return invalid_label, protected_label, or label_conflict. A bad folder returns invalid_folder. block_sender without folder spam returns invalid_block_sender.

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": {
      "inbox_id": "<inbox_id>",
      "thread_id": "<thread_id>"
    },
    "name": "cooper_update_thread"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderNoMove the thread to inbox, archive, spam, or trash. inbox removes the folder row. The same folder twice is a no-op. A bad value returns invalid_folder.
inbox_idYesInbox id (inb_…), username, or full email address owned by this key
thread_idYesThread id (thr_…) whose messages should change labels
add_labelsNoLabels to add on every message. read and unread are allowed. System labels are not.
block_senderNoWhen true, and only with folder spam, add the thread's latest inbound From address to the inbox receive block list. Returns blocked_sender. Without folder spam this returns invalid_block_sender.
remove_labelsNoLabels to remove from every message. Pass ["unread"] to mark the thread read.

Output Schema

NameRequiredDescriptionDefault
idNoThread id (thr_…).
folderNoinbox, archive, spam, or trash.
labelsNoLabels on the object.
previewNoPreview of the latest message.
sendersNoAddresses that sent mail on this thread.
sent_atNoISO-8601 time of the latest outbound message, or null.
subjectNoSubject of the first message.
inbox_idNoInbox id (inb_…) this object belongs to. Null when it applies to every inbox.
assignmentNoCurrent assignment {assignee, note, claimed_until, claim_active, …}, or null.
created_atNoISO-8601 time the object was created.
recipientsNoAddresses that received mail on this thread.
updated_atNoISO-8601 time the object last changed.
purge_afterNoISO-8601 time a trashed thread is deleted, or null.
received_atNoISO-8601 time of the latest inbound message, or null.
message_countNoNumber of messages on the thread.
blocked_senderNoThe block-list entry created when block_sender was true.
last_message_idNoId of the newest message.
attachment_countNoNumber of attachments across the thread.
messages_updatedNoHow many messages changed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "The thread after the update.",
      +  "properties": {
      +    "assignment": {
      +      "description": "Current assignment {assignee, note, claimed_until, claim_active, …}, or null."
      +    },
      +    "attachment_count": {
      +      "description": "Number of attachments across the thread."
      +    },
      +    "blocked_sender": {
      +      "description": "The block-list entry created when block_sender was true."
      +    },
      +    "created_at": {
      +      "description": "ISO-8601 time the object was created."
      +    },
      +    "folder": {
      +      "description": "inbox, archive, spam, or trash."
      +    },
      +    "id": {
      +      "description": "Thread id (thr_…)."
      +    },
      +    "inbox_id": {
      +      "description": "Inbox id (inb_…) this object belongs to. Null when it applies to every inbox."
      +    },
      +    "labels": {
      +      "description": "Labels on the object."
      +    },
      +    "last_message_id": {
      +      "description": "Id of the newest message."
      +    },
      +    "message_count": {
      +      "description": "Number of messages on the thread."
      +    },
      +    "messages_updated": {
      +      "description": "How many messages changed."
      +    },
      +    "preview": {
      +      "description": "Preview of the latest message."
      +    },
      +    "purge_after": {
      +      "description": "ISO-8601 time a trashed thread is deleted, or null."
      +    },
      +    "received_at": {
      +      "description": "ISO-8601 time of the latest inbound message, or null."
      +    },
      +    "recipients": {
      +      "description": "Addresses that received mail on this thread."
      +    },
      +    "senders": {
      +      "description": "Addresses that sent mail on this thread."
      +    },
      +    "sent_at": {
      +      "description": "ISO-8601 time of the latest outbound message, or null."
      +    },
      +    "subject": {
      +      "description": "Subject of the first message."
      +    },
      +    "updated_at": {
      +      "description": "ISO-8601 time the object last changed."
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / block_sender
      Added value: +{
      +  "description": "When true, and only with folder spam, add the thread's latest inbound From address to the inbox receive block list. Returns blocked_sender. Without folder spam this returns invalid_block_sender.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / folder
      Added value: +{
      +  "description": "Move the thread to inbox, archive, spam, or trash. inbox removes the folder row. The same folder twice is a no-op. A bad value returns invalid_folder.",
      +  "enum": [
      +    "inbox",
      +    "archive",
      +    "spam",
      +    "trash"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations it discloses the operation applies to every message in the thread, which labels are mutable (read/unread) versus protected (inbox, sent, auth results), that moving to the same folder twice is a silent no-op, that inbox removes the folder row, that trash sets purge_after to 30 days, and the block_sender side effect on the receive block list. It also enumerates the error outcomes (thread_not_found, invalid_label, protected_label, label_conflict, invalid_folder, invalid_block_sender).

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?

Usage condition is front-loaded, followed by parameter meanings and then behavioral/error details, so an agent can stop reading early. It is dense and duplicates some schema text (e.g. the block_sender and folder explanations appear in both places), which is minor waste but not bloating.

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 6-parameter mutation with an output schema present, the description covers prerequisites (auth), mutation effects, idempotency behavior, side effects, and error surface. Nothing an agent needs to call it correctly is missing, and the return-value explanation is a mild redundancy rather than a gap.

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 already 100%, so the schema carries the baseline; the description still adds value by tying block_sender exclusively to folder spam, clarifying that inbox_id accepts an id, username, or email, and explaining that remove_labels ["unread"] is how a thread is marked read. It restates some parameter text verbatim, which limits the gain.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states specific verbs and resource scope: add/remove labels on every message of a thread, mark read, and move the thread between inbox/archive/spam/trash. It implicitly distinguishes thread-level operations from message-level siblings, but never names cooper_move_threads or cooper_update_messages as the alternative for a subset of messages.

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 opens with an explicit trigger: 'Use this when every message in a conversation should gain or lose the same labels... or when the thread should move to inbox, archive, spam, or trash.' That is a clear condition, though it does not state when to prefer the sibling bulk-move or per-message update tools instead.

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.