Skip to main content
Glama

Clear out a preview

sweeps_apply
DestructiveIdempotent

Move the groups a sweeps_preview counted, each to the trash - Deleted Items in Outlook - or the archive, or into a label or folder the person made in that mailbox, named by its id from labels_list, or mark a group's unread mail read where it is; Gmail moves mail by its labels, taking the inbox label off and adding Trash or the label filed into, and a mailbox held by its password into its trash, archive or label folder - a Gmail's archive being All Mail. Filing into the inbox, the bin, junk, sent mail, drafts, the archive, a Gmail tab or another label Gmail keeps itself is refused (file_refused). Each group is named by its number with the messages count the preview answered, and any count that differs refuses the whole call. Left-out mail is a group too, archived, filed or marked read, never binned: flagged 21, drafts 22, sent 23, own 24, writtenTo 25; deleted and junk mail is never moved. Binning needs a preview narrowed by senders, a domain, a subject phrase or olderThanDays of 30 or more, and leaves a group's receipts, orders, bookings, bills, account and security notices where they are (heldApart). Marking read leaves mail already read as it is (alreadyRead), so putting back never marks it unread. A message changed since the preview is left where it is. A call works for about three minutes and answers per group what moved or was marked read, what changed and what it did not reach, which stays untouched, with up to 20 failures. The same call again under the same sweep, while anything is notReached or failed as unavailable, carries on where the last stopped, settles any message a call cut short left mid-move, and counts no action against the daily allowance. A bin group names bytes, the space the mail this call moved takes, and a call that bins answers trash: binned mail keeps taking the mailbox's space until the bin is emptied, after emptiedAfterDays where its provider empties it itself, and emptyAt is where the person empties it now; archiving frees no space. sweeps_put_back puts it back until putBackUntil. 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>",
      "sweep": "<sweep>",
      "groups": "<groups>"
    },
    "name": "sweeps_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
sweepYesThe sweep handle sweeps_preview answered.
groupsYes
mailboxYesThe mailbox's name or its email address.
onlyIfNewestNotrue acts only while this sweep's preview is still the newest of its mailbox, refused (sweep_replaced) once a newer one is held.

Output Schema

NameRequiredDescriptionDefault
nowYesThe person's own time zone, in which every time this answer gives is written, and their time now in it.
sweepYes
trashNoPresent where this call bins: after how many days the provider empties its bin itself, where Lumman knows, and the page where the person empties it now.
failedYes
groupsYes
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.
putBackUntilYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / groups / items / properties / bytes
      Added value: +{
      +  "description": "For bin: how many bytes the mail this call moved to the bin takes, where every message of it was read with its size.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / trash
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Present where this call bins: after how many days the provider empties its bin itself, where Lumman knows, and the page where the person empties it now.",
      +  "properties": {
      +    "emptiedAfterDays": {
      +      "type": "number"
      +    },
      +    "emptyAt": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  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. Changed1 schema field changed
    • addedInput schema / properties / onlyIfNewest
      Added value: +{
      +  "description": "true acts only while this sweep's preview is still the newest of its mailbox, refused (sweep_replaced) once a newer one is held.",
      +  "type": "boolean"
      +}
  4. Changed3 schema fields changed
    • changedInput schema / properties / groups / items / properties / action / enum
      Previous value: -[
      -  "bin",
      -  "archive",
      -  "read"
      -]New value: +[
      +  "bin",
      +  "archive",
      +  "read",
      +  "file"
      +]
    • addedInput schema / properties / groups / items / properties / label
      Added value: +{
      +  "description": "For file alone: the id labels_list gives the label or folder the group goes into.",
      +  "pattern": "^[A-Za-z0-9_=-]{1,512}$",
      +  "type": "string"
      +}
    • changedOutput schema / properties / groups / items / properties / action / enum
      Previous value: -[
      -  "bin",
      -  "archive",
      -  "read"
      -]New value: +[
      +  "bin",
      +  "archive",
      +  "read",
      +  "file"
      +]
  5. Changed3 schema fields changed
    • changedInput schema / properties / groups / items / properties / action / enum
      Previous value: -[
      -  "bin",
      -  "archive"
      -]New value: +[
      +  "bin",
      +  "archive",
      +  "read"
      +]
    • changedOutput schema / properties / groups / items / properties / action / enum
      Previous value: -[
      -  "bin",
      -  "archive"
      -]New value: +[
      +  "bin",
      +  "archive",
      +  "read"
      +]
    • addedOutput schema / properties / groups / items / properties / alreadyRead
      Added value: +{
      +  "type": "number"
      +}
  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",
      -  "groups",
      -  "failed"
      -]New value: +[
      +  "sweep",
      +  "putBackUntil",
      +  "groups",
      +  "failed",
      +  "now"
      +]
  7. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond annotations that already mark it destructive, non-readonly, closed-world, and idempotent, the description discloses refusal rules, count-mismatch rollback, heldApart and alreadyRead exceptions, notReached/failed resumption, daily-allowance behavior, trash space semantics, and put-back timing. This is unusually rich behavioral context for a destructive mutation.

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

Conciseness2/5

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

The description is one dense run-on paragraph full of semicolons, dashes, and shorthand error codes, so special-group rules and failure behavior are hard to scan. It is front-loaded with the core action, but it is not concise and its structure works against understanding.

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 complex destructive batch operation with an output schema, the definition covers provider-specific destinations, refused filing targets, preview constraints, partial failure and resume behavior, and undo timing. An agent has enough context to invoke it carefully, even if the prose is difficult to parse.

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 75%, and the description adds meaningful semantics: group numbers and message counts come from the preview, counts must match or the call refuses, action values correspond to bin/archive/read/file, label ids come from labels_list, and onlyIfNewest guards against a replaced sweep. The mapping is embedded in prose rather than explicitly keyed to parameter names, but it adds substantial meaning.

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 opening clause states a specific mutation: it moves groups counted by sweeps_preview to trash, archive, a label/folder, or marks them read. It distinguishes itself from sweeps_preview and sweeps_put_back, though the purpose is buried inside a long conditional sentence rather than stated crisply.

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?

The description explains that this acts on a preview, that binning requires a preview narrowed by sender, domain, subject phrase, or olderThanDays of 30+, and that retries resume incomplete work. It also describes refusal conditions and the onlyIfNewest guard, but it never gives a compact 'use this when' statement against the other sweep or thread tools.

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.