Skip to main content
Glama

block_sender

Destructive

Create a persistent Gmail filter to block a sender in one account so future matching mail is automatically trashed, marked spam, or archived; existing messages stay untouched by default.

Instructions

Block a sender in ONE account by creating a persistent Gmail filter (the same mechanism as Gmail's native "Block" button): future mail matching from:<sender> is auto-trashed, marked spam, or archived. This is a settings change that keeps applying until it is removed, and future mail is silently dropped — say what you are about to block and why before calling it. By default NO existing mail is touched; set also_trash_existing=true only when the user asks for a cleanup as well. Reverse with unblock_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": {
      "account": "<account>",
      "sender": "<sender>"
    },
    "name": "block_sender"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoWhat to do with matching mail. "trash" (default) mirrors Gmail's Block button.trash
senderYesEmail address (e.g. "spam@foo.com"), domain ("@foo.com"), or Gmail search fragment ("from:x subject:promo").
accountYesAccount id ("personal", "tamu").
also_trash_existingNoIf true, ALSO retroactively trashes up to 100 existing messages from this sender. Defaults to false — blocking should not bulk-trash mail as a side effect. Trash is recoverable for 30 days.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.2

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the destructiveHint annotation by disclosing that the filter is persistent, keeps applying until removed, silently drops future mail, and touches no existing mail by default. It also explains reversibility and the recoverability window for trashed mail, which directly informs the risk of the destructive operation.

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

Conciseness5/5

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

Front-loads the core action and mechanism, then the behavioral warning, then the opt-in flag, then the reversal path. Every sentence carries decision-relevant information with no filler.

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 destructive settings mutation with no output schema, the description covers persistence, defaults, opt-in side effects, recoverability, confirmation etiquette, and the inverse tool. Nothing an agent needs in order to call it safely 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 100%, so the baseline is 3; the description adds real guidance on top by clarifying that also_trash_existing defaults to off and should only be enabled on explicit user request, and by framing action modes as what happens to matching mail. The sender parameter's accepted forms are already fully documented in the schema, so no extra credit there.

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?

States a specific verb and resource ("Block a sender in ONE account") and explains the mechanism precisely as "a persistent Gmail filter (the same mechanism as Gmail's native 'Block' button)". It explicitly scopes to a single account and distinguishes itself from the sibling unblock_sender, so an agent can select it without opening the schema.

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?

Gives explicit when-to-use behavior: blocking is the default, existing mail is untouched unless the user asks for cleanup, and also_trash_existing=true should only be set when a cleanup is requested. It also names the reversal path ("Reverse with unblock_sender") and instructs the agent to state what it will block before calling.

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