Skip to main content
Glama

bulk_unsubscribe

Idempotent

Unsubscribe from multiple mailing lists in one call using each thread's List-Unsubscribe header, with per-sender deduplication and dry-run rehearsal before any request is sent.

Instructions

Unsubscribe from several mailing lists in one call, one thread id per list. Threads are processed SEQUENTIALLY, and at most ONE request is made per sender — a thread from a sender whose request already went out (in this call, an earlier call of this session, or a call still running) is reported with duplicateOf and no request (and says so when it advertises a DIFFERENT endpoint, i.e. is probably a separate list from the same sender). The whole call shares a 60-second budget; threads left over when it runs out come back with skippedOutOfTime and a reason, so re-running with the remaining ids finishes the job. Like unsubscribe, there is no URL parameter: every endpoint comes from that thread's own List-Unsubscribe header. Only RFC 8058 one-click senders are contacted; the rest come back with their alternatives in options. Partial success is reported, never hidden: a thread that cannot be read or whose endpoint fails becomes an entry with a reason, and the remaining threads still run. Set dryRun:true to rehearse: same header reads, same per-sender dedupe (as a real run with every request succeeding, against the senders recorded at that moment), and each entry a real run would contact reports the endpoint it wouldCall; refusals and duplicates carry none — and nobody is contacted. USE WHEN: clearing out several newsletters at once — pair with list_subscriptions, which gives you the sender rows and their newestThreadId; dryRun first to show the user which senders would be contacted. DO NOT USE: for one thread (use unsubscribe), or to find candidates (use list_subscriptions — it contacts nobody). SIDE EFFECTS: up to one outbound HTTPS request per DISTINCT sender (plus up to 3 redirects each) — the only non-Google hosts mailwarden ever contacts (none with dryRun). Each confirms to that sender that the address is live, and none of it can be undone. The mailbox itself is not changed.

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": {
      "threadIds": "<threadIds>"
    },
    "name": "bulk_unsubscribe"
  }
}

Input Schema

NameRequiredDescriptionDefault
dryRunNo
threadIdsYes

Output Schema

NameRequiredDescriptionDefault
dryRunYes
resultsYes
requestsYes
attemptedYes
requestedYes
unsubscribedYes
skippedOutOfTimeYes
skippedDuplicatesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.32.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv0.25.0
    • removedInput schema / additionalProperties
      Removed value: -false
  3. Changed5 schema fields changedv0.11.0
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / dryRun
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / requests
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / results / items / properties / wouldCall
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "requested",
      -  "attempted",
      -  "unsubscribed",
      -  "skippedDuplicates",
      -  "skippedOutOfTime",
      -  "results"
      -]New value: +[
      +  "dryRun",
      +  "requested",
      +  "attempted",
      +  "unsubscribed",
      +  "skippedDuplicates",
      +  "skippedOutOfTime",
      +  "requests",
      +  "results"
      +]
  4. Addedv0.9.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes far beyond the annotations: sequential processing, one request per distinct sender, cross-call/session dedupe with `duplicateOf`, a 60-second shared budget with `skippedOutOfTime`, RFC 8058-only contact policy, and partial-success reporting. It also spells out side effects (outbound HTTPS to non-Google hosts, address confirmation, irreversibility, mailbox unchanged) and gives exact dryRun semantics, which the annotations alone could not convey.

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?

Front-loads the core behavior and separates usage, side effects, and dryRun into scannable blocks, but the parenthetical about a duplicate advertising a different endpoint is densely nested and slows parsing. Overall the length is justified by the behavioral surface, with only minor trimming possible.

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 2-parameter mutation with an output schema present, everything an agent needs is covered: which senders get contacted, what happens on budget exhaustion, what each failure entry looks like, how to resume, and how to rehearse safely. Nothing necessary is deferred to the structured fields.

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 description coverage is 0%, so the description must carry parameter meaning — it does so well for dryRun (rehearse, same header reads, same dedupe, reports `wouldCall`, contacts nobody) and clarifies threadIds as one id per list. It omits the schema's 1–25 item bound and id format details, which would matter for a 0%-coverage schema.

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?

Names a specific verb and resource ('Unsubscribe from several mailing lists in one call'), states the batching unit ('one thread id per list'), and differentiates from the single-thread sibling by explicitly pointing to unsubscribe for one thread.

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?

Provides explicit USE WHEN ('clearing out several newsletters at once — pair with list_subscriptions') and DO NOT USE clauses naming both alternatives (unsubscribe for one thread, list_subscriptions for finding candidates). It even prescribes dryRun-first as the recommended workflow.

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