Skip to main content
Glama
mail-mcp-server

mail-mcp-server

plan_create_filter

Preview a Gmail filter for a sender, domain, or search query and see which existing mail it would affect before approving execution via a plan ID.

Instructions

Dry run: changes nothing. Returns what would be affected and a plan_id for execute_plan. Show the user the summary before asking whether to execute. A Gmail filter for future mail, matched by one sender or domain (from) or any Gmail search (query), with one action or several combined as in Gmail's filter dialog: archive (skip inbox), trash (block), label, never_spam, mark_read, star, important, never_important, categorize, forward. Reports how much existing mail matches; plan_modify handles that mail.

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": "plan_create_filter"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoSender address or domain (give this or query)
labelNoLabel name, for label and label_and_archive
queryNoGmail search, e.g. "from:(a@x.com OR b@y.com)" (give this or from)
actionNoOne action (or use actions)
actionsNoSeveral actions together
mailboxYesA connected mailbox address (see list_mailboxes)
categoryNoTab, for categorize
forward_toNoA confirmed forwarding address, for forward

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden well: it says this is a dry run, changes nothing, reports affected mail, and returns a plan_id for later execution. It does not cover permissions, plan expiry, or exact response format, but it discloses the critical non-mutating behavior and the future-mail scope.

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?

The description is front-loaded with the dry-run behavior and plan_id handoff, which are the most important facts. The long action list partly duplicates the schema enum, but the parenthetical clarifications for archive and trash add value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an eight-parameter tool with no output schema, the description explains the key return information: what would be affected, a plan_id, and how much existing mail matches. It also explains the future-mail scope and points to plan_modify for existing mail, leaving only minor details such as exact summary format unspecified.

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 schema already documents all eight parameters and enums. The description adds useful context by framing from/query as alternatives and clarifying that actions can be combined as in Gmail's filter dialog, including archive as skip inbox and trash as block.

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 description states a specific verb and resource: it creates a dry-run Gmail filter plan, changes nothing, and returns a plan_id for execute_plan. It clearly distinguishes this planning step from execution and from plan_modify, which handles existing mail.

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?

It explicitly tells the agent to use this as a dry run, show the user the summary before asking whether to execute, and use execute_plan with the returned plan_id. It also routes the existing-mail case to plan_modify, giving clear alternatives.

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