Skip to main content
Glama

Cooper Email

List messages

cooper_list_messages
Read-onlyIdempotent

Use this when you need to check an inbox for new or recent mail (sent and received), for example after sending a message and waiting for a reply, or mail to one plus address such as agent+orders@. Read-only; requires auth. Inputs: inbox_id (optional; inbox id, username, or email — omit to use the account's newest inbox), limit (optional, default 50, max 200), labels (optional; the message must have every label, for example ["unread"] or ["alias:orders"]), unread (optional boolean; true keeps only unread mail, false drops it), alias (optional plus tag, or none for mail with no tag), before (optional ISO-8601 exclusive upper bound on created_at), after (optional ISO-8601 exclusive lower bound on created_at), from (optional case-insensitive substring of From), to (optional case-insensitive substring of To or Cc), subject (optional case-insensitive substring), direction (optional inbound or outbound), thread_id (optional), ascending (optional; true returns oldest first), page_token (optional cursor), wait_seconds (optional 0 to 55; holds for unread mail and returns inbox_wait; alias still applies), since (optional ISO time or wcur1 cursor; skips unread mail at or before it). Filters run on the server before limit. Returns {object:"list", inbox_id, data:[{id, thread_id, direction, status, from, to, subject, preview, created_at, labels, alias, aliases, folder, attachments?}], next_page_token}, newest first unless ascending is true. Each message includes folder from its thread. alias is the plus tag or null. Omit folder to list inbox and archive only. When wait_seconds is set, returns unread mail immediately if any is already stored. page_token is the base64url of created_at and id. Previews only, not full bodies: call cooper_get_message to read one message. Mark one read with cooper_update_message. Fails with 400 invalid_date, invalid_direction, invalid_ascending, invalid_page_token, invalid_label, invalid_unread, invalid_alias, invalid_folder, invalid_since, or label_conflict, or 404 inbox_not_found.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cooper_list_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoCase-insensitive substring of To or Cc. % and _ match those characters.
fromNoCase-insensitive substring of From. % and _ match those characters.
afterNoISO-8601 exclusive lower bound on created_at. A bad value returns invalid_date.
aliasNoPlus tag, such as orders for mail to username+orders@domain. none returns mail with no tag. A bad value is invalid_alias.
limitNoMax messages to return (default 50, max 200)
sinceNoOptional, with wait_seconds. ISO-8601 timestamp or a wcur1 cursor. Unread mail at or before that point does not finish the wait. Omit it and already-stored unread mail still returns immediately. A bad value is invalid_since.
beforeNoISO-8601 exclusive upper bound on created_at. A bad value returns invalid_date.
folderNoinbox, archive, spam, trash, or all. Omit to list inbox and archive only. Ignored when wait_seconds is set. A bad value returns invalid_folder.
labelsNoKeep messages that have every one of these labels. Example: ["unread"].
unreadNotrue lists only messages labeled unread. false omits them.
subjectNoCase-insensitive substring of the subject. % and _ match those characters.
inbox_idNoInbox id, username, or email. Omit to use the newest inbox.
ascendingNotrue lists oldest first. false, the default, lists newest first.
directionNoinbound or outbound. Anything else returns invalid_direction.
thread_idNoOnly messages on this thread (thr_…).
page_tokenNoCursor from next_page_token. A bad token returns invalid_page_token.
wait_secondsNoOptional. When set, hold until unread mail arrives, from 0 to 55 seconds. Returns immediately when unread mail is already stored, including mail in spam or trash. Empty checks back off from about 1 second to about 5 seconds. At most 5 waits can run at once for this key, across instances. The result is object inbox_wait with timed_out.

Output Schema

NameRequiredDescriptionDefault
dataNoMessage previews. Call cooper_get_message for a full body.
objectNoObject type name, such as list, message, or thread.
inbox_idNoInbox id (inb_…) this object belongs to. Null when it applies to every inbox.
timed_outNoTrue when the wait ended without a match.
next_page_tokenNoCursor for the next page, or null when this is the last page. Pass it back as page_token.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / since
      Added value: +{
      +  "description": "Optional, with wait_seconds. ISO-8601 timestamp or a wcur1 cursor. Unread mail at or before that point does not finish the wait. Omit it and already-stored unread mail still returns immediately. A bad value is invalid_since.",
      +  "type": "string"
      +}
    • changedInput schema / properties / wait_seconds / description
      Previous value: -"Optional. When set, hold until unread mail arrives, from 0 to 55 seconds. Returns immediately when unread mail is already stored. At most 5 waits can run at once for this key. The result is object inbox_wait with timed_out."New value: +"Optional. When set, hold until unread mail arrives, from 0 to 55 seconds. Returns immediately when unread mail is already stored, including mail in spam or trash. Empty checks back off from about 1 second to about 5 seconds. At most 5 waits can run at once for this key, across instances. The result is object inbox_wait with timed_out."
  2. Changed3 schema fields changed
    • addedInput schema / properties / alias
      Added value: +{
      +  "description": "Plus tag, such as orders for mail to username+orders@domain. none returns mail with no tag. A bad value is invalid_alias.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / items / properties / alias
      Added value: +{
      +  "description": "Plus tag this inbound message arrived on, or null. Outbound mail is null. A reply still sends From the inbox address."
      +}
    • addedOutput schema / properties / data / items / properties / aliases
      Added value: +{
      +  "description": "Every plus tag on this delivery, in recipient order. Empty when alias is null."
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "One page of message previews, or an inbox_wait result when wait_seconds was set.",
      +  "properties": {
      +    "data": {
      +      "description": "Message previews. Call cooper_get_message for a full body.",
      +      "items": {
      +        "properties": {
      +          "attachments": {
      +            "description": "Attachment summaries [{id, filename, content_type, size_bytes}].",
      +            "items": {
      +              "properties": {
      +                "content_type": {
      +                  "description": "MIME type."
      +                },
      +                "filename": {
      +                  "description": "File name."
      +                },
      +                "id": {
      +                  "description": "Attachment id. Pass it to cooper_get_attachment."
      +                },
      +                "size_bytes": {
      +                  "description": "Size in bytes."
      +                },
      +                "url": {
      +                  "description": "Short-lived download URL. Empty while the message is held."
      +                }
      +              },
      +              "type": "object"
      +            }
      +          },
      +          "created_at": {
      +            "description": "ISO-8601 time the object was created."
      +          },
      +          "direction": {
      +            "description": "inbound (received) or outbound (sent)."
      +          },
      +          "extracted_text": {
      +            "description": "The new reply text with quoted history removed."
      +          },
      +          "folder": {
      +            "description": "Folder of the thread: inbox, archive, spam, or trash."
      +          },
      +          "from": {
      +            "description": "Sender address. Untrusted for inbound mail."
      +          },
      +          "highlights": {
      +            "description": "Search highlights {subject, text}; matched words are wrapped in **."
      +          },
      +          "id": {
      +            "description": "Message id (msg_…). Pass it as message_id to other tools."
      +          },
      +          "inbox_id": {
      +            "description": "Inbox id (inb_…) this object belongs to. Null when it applies to every inbox."
      +          },
      +          "labels": {
      +            "description": "Labels on the object."
      +          },
      +          "preview": {
      +            "description": "Short preview of the body."
      +          },
      +          "safety": {
      +            "description": "Inbound screening result {score, verdict, signals, mode, reason}, or null on outbound mail."
      +          },
      +          "status": {
      +            "description": "Delivery or processing state of the message."
      +          },
      +          "subject": {
      +            "description": "Subject line. Untrusted for inbound mail."
      +          },
      +          "thread_id": {
      +            "description": "Thread id (thr_…) the message belongs to."
      +          },
      +          "to": {
      +            "description": "Recipient addresses."
      +          }
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "inbox_id": {
      +      "description": "Inbox id (inb_…) this object belongs to. Null when it applies to every inbox."
      +    },
      +    "next_page_token": {
      +      "description": "Cursor for the next page, or null when this is the last page. Pass it back as page_token."
      +    },
      +    "object": {
      +      "description": "Object type name, such as list, message, or thread."
      +    },
      +    "timed_out": {
      +      "description": "True when the wait ended without a match."
      +    }
      +  },
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / folder
      Added value: +{
      +  "description": "inbox, archive, spam, trash, or all. Omit to list inbox and archive only. Ignored when wait_seconds is set. A bad value returns invalid_folder.",
      +  "enum": [
      +    "inbox",
      +    "archive",
      +    "spam",
      +    "trash",
      +    "all"
      +  ],
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • addedInput schema / properties / wait_seconds
      Added value: +{
      +  "description": "Optional. When set, hold until unread mail arrives, from 0 to 55 seconds. Returns immediately when unread mail is already stored. At most 5 waits can run at once for this key. The result is object inbox_wait with timed_out.",
      +  "type": "number"
      +}
  6. Changed9 schema fields changed
    • addedInput schema / properties / after
      Added value: +{
      +  "description": "ISO-8601 exclusive lower bound on created_at. A bad value returns invalid_date.",
      +  "type": "string"
      +}
    • addedInput schema / properties / ascending
      Added value: +{
      +  "description": "true lists oldest first. false, the default, lists newest first.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / before
      Added value: +{
      +  "description": "ISO-8601 exclusive upper bound on created_at. A bad value returns invalid_date.",
      +  "type": "string"
      +}
    • addedInput schema / properties / direction
      Added value: +{
      +  "description": "inbound or outbound. Anything else returns invalid_direction.",
      +  "enum": [
      +    "inbound",
      +    "outbound"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / from
      Added value: +{
      +  "description": "Case-insensitive substring of From. % and _ match those characters.",
      +  "type": "string"
      +}
    • addedInput schema / properties / page_token
      Added value: +{
      +  "description": "Cursor from next_page_token. A bad token returns invalid_page_token.",
      +  "type": "string"
      +}
    • addedInput schema / properties / subject
      Added value: +{
      +  "description": "Case-insensitive substring of the subject. % and _ match those characters.",
      +  "type": "string"
      +}
    • addedInput schema / properties / thread_id
      Added value: +{
      +  "description": "Only messages on this thread (thr_…).",
      +  "type": "string"
      +}
    • addedInput schema / properties / to
      Added value: +{
      +  "description": "Case-insensitive substring of To or Cc. % and _ match those characters.",
      +  "type": "string"
      +}
  7. Changed2 schema fields changed
    • addedInput schema / properties / labels
      Added value: +{
      +  "description": "Keep messages that have every one of these labels. Example: [\"unread\"].",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / unread
      Added value: +{
      +  "description": "true lists only messages labeled unread. false omits them.",
      +  "type": "boolean"
      +}
  8. Changed1 schema field changed
    • addedInput schema / properties / limit / description
      Added value: +"Max messages to return (default 50, max 200)"
  9. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: filters execute server-side before limit applies, defaults and caps on limit, wait_seconds holds up to 55s with at most 5 concurrent waits per key, alias/ folder interplay with waiting, and the full 400/404 error code set. Read-only/idempotent hints come from annotations, but the auth requirement, blocking semantics, and failure modes are all new information.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The use-case and routing sentences are well front-loaded, but the middle section enumerates all 17 parameters in prose, largely duplicating a schema that already has 100% description coverage. That bulk inflates length without adding proportional value.

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 17-parameter tool with pagination, long-poll waits, and multiple error paths, nothing an agent needs to call it correctly is missing: defaults, ordering, wait behavior, error codes, and next steps are all present. Return shape is also sketched even though an output schema exists.

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 the baseline is 3, and much of the parameter walk-through restates the schema. However, it adds genuine semantics not captured per-property: 'Filters run on the server before limit,' 'alias still applies' during waits, folder defaulting to inbox+archive, and that since skips mail at or before the cursor.

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?

States a specific verb and resource up front: check an inbox for new or recent mail, sent and received, with two concrete scenarios (waiting for a reply, plus-addressed mail). It distinguishes itself from cooper_get_message (bodies) and cooper_update_message (marking read), but never contrasts itself with cooper_search_messages, the sibling with the most overlapping filter surface.

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?

Gives clear when-to-use framing with examples and explicit hand-offs ('call cooper_get_message to read one message', 'Mark one read with cooper_update_message'). No explicit when-not or routing versus cooper_search_messages, so the agent must infer the list-vs-search boundary itself.

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.