Skip to main content
Glama

Preview a clear-out

sweeps_preview
Read-only

Count who fills one folder of a mailbox, the inbox unless folder names another, before clearing it out by sender - newsletters, promotions and notifications a group at a time rather than thread by thread, each group sweeps_apply moves once the person approves it; nothing is moved. The answer numbers the 20 senders with the most mail there, each with its count, how many are unread, its newest and oldest dates, two of its subjects, and heldApart: how many are receipts, orders, bookings, bills, account or security notices. otherSenders and otherMessages count the rest, and nextSenders names the next 20 of them by address with how many messages each has, for another preview to name in senders. A sender whose name screens as a prompt attack is withheld with its group, which takes no number, counted under withheldSenders and withheldMessages; a subject that does leaves its group's subjects, counted under withheldSubjects; a next sender's address that does leaves nextSenders, counted under withheldNextSenders. rankBy space finds what fills a full mailbox: the senders are ranked by the space their mail takes, each group naming it in bytes, and largest names the 10 largest messages the groups counted by group, bytes, date and subject - a subject that screens as a prompt attack null, marked withheldSubject. Flagged mail, drafts, the person's own messages, mail from people they write to, and everything in sent, drafts, deleted or junk is in no group, counted under leftOut instead. At most the newest 10,000 messages of an Outlook folder, or of a mailbox held by its password, are read, and notReadBefore names the date before which a larger folder was not. A mailbox held by its password is cleared out only where its mail server names where it moves each message, and a Gmail held by its password out of its inbox alone. Gmail allows few reads a minute, so only the newest 150 of a Gmail folder are read: they choose the groups, and each group's messages then counts all its sender's mail the preview asks for, up to 10,000 in all, unless the preview narrows by subject or ranks by space; its other figures, otherSenders, otherMessages, nextSenders and leftOut count the messages read, and folderTotal is Gmail's own estimate. actionsLeft is how many actions this account has left in its allowance after this call. sweep is the handle sweeps_apply clears what was counted by, held an hour; what an apply moves can be put back until putBackUntil at the earliest. The times it answers with carry their offset in the person's own time zone, which the answer names under now beside their time now in it - UTC where the person has stored no zone, as now says.

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": {
      "mailbox": "<mailbox>"
    },
    "name": "sweeps_preview"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNoGmail alone: only the mail in this tab of its inbox is counted, as focus counts Outlook's Focused or Other.
listNoOnly mail from this mailing list is counted, by its list id: what a message's listId holds between its angle brackets, as news.example.com.
focusNoOutlook alone: only the mail Outlook sorts into Focused, or only that in Other, is counted. Outlook sorts its inbox alone.
domainNoOnly mail from this domain or one under it is counted, as example.com.
folderNoThe folder to read, inbox by default; all of sent, drafts, deleted and junk is left out.
rankByNoRanks the senders by how many messages each has where count, the default, or by the space their mail takes where space.
unreadNotrue counts only unread mail, false only read mail.
mailboxYesThe mailbox's name or its email address.
sendersNoOnly mail from these addresses is counted.
subjectNoOnly mail whose subject holds this phrase, letter case aside, is counted.
keepNewestNoThe newest this many of each sender's messages are left out of the count, so only the rest is counted.
olderThanDaysNoOnly mail that arrived more than this many days ago is counted.
excludeSubjectsNoMail whose subject holds any of these phrases is left out of the count.
largerThanBytesNoOnly mail larger than this many bytes is counted, as 5000000 for mail over 5 MB.

Output Schema

NameRequiredDescriptionDefault
nowYesThe person's own time zone, in which every time this answer gives is written, and their time now in it.
readYes
sweepYes
groupsYes
largestNoRanked by space: the largest messages the groups counted, largest first, each by its group, its bytes, date and subject.
leftOutYes
notReadNo
newestOnlyNoThe folders whose provider showed only their newest messages, each with how many it showed: every one holds more, and nothing before those was read, searched, counted or acted on, so finding nothing there says nothing of the rest.
actionsLeftNo
folderTotalYes
nextSendersNo
otherSendersYes
putBackUntilYes
notReadBeforeYes
otherMessagesYes
withheldSendersNo
withheldMessagesNo
withheldNextSendersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / rankBy
      Added value: +{
      +  "description": "Ranks the senders by how many messages each has where count, the default, or by the space their mail takes where space.",
      +  "enum": [
      +    "count",
      +    "space"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / groups / items / properties / bytes
      Added value: +{
      +  "description": "Ranked by space: how many bytes the group's counted mail takes.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / largest
      Added value: +{
      +  "description": "Ranked by space: the largest messages the groups counted, largest first, each by its group, its bytes, date and subject.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "bytes": {
      +        "type": "number"
      +      },
      +      "date": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "group": {
      +        "type": "number"
      +      },
      +      "subject": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "withheldSubject": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "group",
      +      "bytes",
      +      "date",
      +      "subject"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / newestOnly
      Added value: +{
      +  "description": "The folders whose provider showed only their newest messages, each with how many it showed: every one holds more, and nothing before those was read, searched, counted or acted on, so finding nothing there says nothing of the rest.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "folder": {
      +        "type": "string"
      +      },
      +      "shown": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "folder",
      +      "shown"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Changed10 schema fields changed
    • changedInput schema / properties / domain / description
      Previous value: -"Count only mail from this domain or one under it, as example.com."New value: +"Only mail from this domain or one under it is counted, as example.com."
    • changedInput schema / properties / excludeSubjects / description
      Previous value: -"Leave out of the count mail whose subject holds any of these phrases."New value: +"Mail whose subject holds any of these phrases is left out of the count."
    • changedInput schema / properties / focus / description
      Previous value: -"Outlook alone: count only the mail Outlook sorts into Focused, or only that in Other. Outlook sorts its inbox alone."New value: +"Outlook alone: only the mail Outlook sorts into Focused, or only that in Other, is counted. Outlook sorts its inbox alone."
    • changedInput schema / properties / keepNewest / description
      Previous value: -"Leave the newest this many of each sender's messages out of the count, so only the rest is counted."New value: +"The newest this many of each sender's messages are left out of the count, so only the rest is counted."
    • changedInput schema / properties / largerThanBytes / description
      Previous value: -"Count only mail larger than this many bytes, as 5000000 for mail over 5 MB."New value: +"Only mail larger than this many bytes is counted, as 5000000 for mail over 5 MB."
    • changedInput schema / properties / list / description
      Previous value: -"Count only mail from this mailing list, by its list id: what a message's listId holds between its angle brackets, as news.example.com."New value: +"Only mail from this mailing list is counted, by its list id: what a message's listId holds between its angle brackets, as news.example.com."
    • changedInput schema / properties / olderThanDays / description
      Previous value: -"Count only mail that arrived more than this many days ago."New value: +"Only mail that arrived more than this many days ago is counted."
    • changedInput schema / properties / senders / description
      Previous value: -"Count only mail from these addresses."New value: +"Only mail from these addresses is counted."
    • changedInput schema / properties / subject / description
      Previous value: -"Count only mail whose subject holds this phrase, letter case aside."New value: +"Only mail whose subject holds this phrase, letter case aside, is counted."
    • changedInput schema / properties / tab / description
      Previous value: -"Gmail alone: count only the mail in this tab of its inbox, as focus counts Outlook's Focused or Other."New value: +"Gmail alone: only the mail in this tab of its inbox is counted, as focus counts Outlook's Focused or Other."
  4. Changed6 schema fields changed
    • addedInput schema / properties / focus
      Added value: +{
      +  "description": "Outlook alone: count only the mail Outlook sorts into Focused, or only that in Other. Outlook sorts its inbox alone.",
      +  "enum": [
      +    "focused",
      +    "other"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / largerThanBytes
      Added value: +{
      +  "description": "Count only mail larger than this many bytes, as 5000000 for mail over 5 MB.",
      +  "maximum": 2147483647,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / list
      Added value: +{
      +  "description": "Count only mail from this mailing list, by its list id: what a message's listId holds between its angle brackets, as news.example.com.",
      +  "pattern": "^[a-z0-9_-]+(?:\\.[a-z0-9_-]+)+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / tab
      Added value: +{
      +  "description": "Gmail alone: count only the mail in this tab of its inbox, as focus counts Outlook's Focused or Other.",
      +  "enum": [
      +    "primary",
      +    "social",
      +    "promotions",
      +    "updates",
      +    "forums"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / nextSenders
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "address": {
      +        "type": "string"
      +      },
      +      "messages": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "address",
      +      "messages"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / withheldNextSenders
      Added value: +{
      +  "type": "number"
      +}
  5. Changed2 schema fields changed
    • changedOutput schema / properties / folderTotal / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • addedOutput schema / properties / notRead
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "count",
      +      "sentMail",
      +      "messages"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. Changed2 schema fields changed
    • addedOutput schema / properties / now
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The person's own time zone, in which every time this answer gives is written, and their time now in it.",
      +  "properties": {
      +    "noneStored": {
      +      "description": "Present where the person has stored no time zone: that every time here is UTC, and how one gets stored.",
      +      "type": "string"
      +    },
      +    "time": {
      +      "type": "string"
      +    },
      +    "timeZone": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "timeZone",
      +    "time"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "sweep",
      -  "putBackUntil",
      -  "read",
      -  "folderTotal",
      -  "notReadBefore",
      -  "groups",
      -  "otherSenders",
      -  "otherMessages",
      -  "leftOut"
      -]New value: +[
      +  "sweep",
      +  "putBackUntil",
      +  "read",
      +  "folderTotal",
      +  "notReadBefore",
      +  "groups",
      +  "otherSenders",
      +  "otherMessages",
      +  "leftOut",
      +  "now"
      +]
  7. Changed1 schema field changed
    • addedInput schema / properties / keepNewest
      Added value: +{
      +  "description": "Leave the newest this many of each sender's messages out of the count, so only the rest is counted.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  8. Changed1 schema field changed
    • changedInput schema / properties / unread / description
      Previous value: -"true counts only unread mail."New value: +"true counts only unread mail, false only read mail."
  9. Changed3 schema fields changed
    • addedOutput schema / properties / groups / items / properties / withheldSubjects
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / withheldMessages
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / withheldSenders
      Added value: +{
      +  "type": "number"
      +}
  10. Changed3 schema fields changed
    • addedOutput schema / properties / putBackUntil
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / sweep
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "read",
      -  "folderTotal",
      -  "notReadBefore",
      -  "groups",
      -  "otherSenders",
      -  "otherMessages",
      -  "leftOut"
      -]New value: +[
      +  "sweep",
      +  "putBackUntil",
      +  "read",
      +  "folderTotal",
      +  "notReadBefore",
      +  "groups",
      +  "otherSenders",
      +  "otherMessages",
      +  "leftOut"
      +]
  11. Added

TDQS

A4.5/5.0
Behavior5/5

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

Far beyond readOnlyHint/destructiveHint=false, it discloses read caps (newest 10,000 messages, 150 for Gmail folders), Gmail rate limits, what gets excluded into leftOut (flagged, drafts, own messages, sent/drafts/deleted/junk), prompt-attack withholding behavior, the one-hour life of the sweep handle, the putBackUntil undo window, actionsLeft consumption and timezone/now handling. These are exactly the operational facts an agent cannot get from annotations.

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 purpose and scope are correctly front-loaded, and most clauses carry genuinely useful behavior. But it is one sprawling run-on block of densely packed subordinate clauses, and a large share of it re-narrates return fields (heldApart, otherSenders, withheldSenders, largest, folderTotal, actionsLeft) that the output schema already defines, making it harder to scan than it needs to be.

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 14-parameter tool with provider-specific quirks (Gmail vs Outlook, password-held mailboxes) the description covers the caps, the exclusions, the withholding rules and the handle lifecycle that determine whether a call is even meaningful. Nothing an agent needs in order to call this correctly is missing.

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 per-parameter definitions. The description still adds real meaning: rankBy=space changes the answer shape (bytes per group plus a largest list), and nextSenders exists specifically so a follow-up preview can name those addresses in senders — an interplay the schema does not express. It says nothing extra about olderThanDays, excludeSubjects, largerThanBytes, domain, list, tab or focus beyond the schema text.

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 opening clause states a specific verb and resource — counting who fills one folder of a mailbox before it is cleared out by sender group — and explicitly marks the boundary with the sibling: 'each group sweeps_apply moves once the person approves it; nothing is moved.' An agent can tell this apart from sweeps_apply without opening either schema.

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 clearly frames the tool as the pre-flight step before sweeps_apply and states the non-mutating nature, which tells the agent where in the workflow it belongs. It never explicitly says when to prefer other read tools (messages_list, messages_list_all_mailboxes) or when a preview is unnecessary, so the routing guidance is contextual rather than explicit.

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.