Skip to main content
Glama
cunicopia-dev

gmail-mcp

create_filter

Create Gmail filters to automatically archive, mark read, delete, star, or label new incoming messages based on sender, subject, query, or attachments—reducing recurring email noise.

Instructions

Create a Gmail filter that auto-acts on matching incoming mail (the durable fix for recurring newsletter/promo noise — unlike modify_labels, which only touches existing messages). Supply at least one match criterion (from_address/to_address/subject/query/has_attachment) and at least one action. Actions: convenience flags archive/mark_read/delete/star, plus add_labels/remove_labels for any other label (names or ids, must already exist). Filters cannot forward mail off-account by design. Note: a filter only affects mail that ARRIVES after it's created; clear existing backlog with search + modify_labels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
starNoStar it (adds STARRED label).
queryNoRaw Gmail search expression for arbitrary criteria, e.g. 'list:promotions.example.com'.
deleteNoSend to Trash (adds TRASH label).
accountYesEmail address of the authorized Gmail account to act on.
archiveNoSkip the Inbox (removes INBOX label).
subjectNoMatch words in the subject.
mark_readNoMark as read (removes UNREAD label).
add_labelsNoLabels to apply (names or ids; must exist).
to_addressNoMatch recipient (criteria 'to').
from_addressNoMatch sender (criteria 'from'). Accepts a Gmail from-expression, e.g. 'a@b.com OR c@d.com'.
remove_labelsNoLabels to remove (names or ids; must exist).
has_attachmentNoOnly match messages with an attachment.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.7.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses that filters only affect mail arriving after creation, that labels must already exist, that at least one criterion and action are required, and that off-account forwarding is impossible. It could add error behavior or idempotency details, but the essential side effects and limitations are clearly communicated.

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?

The description is dense but well-organized: purpose and differentiation first, then parameter constraints and actionable categories, then critical caveats. Every sentence contributes unique information, and there is no redundant restating of schema field names.

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 tool with 12 parameters, no annotations, and no output schema, the description covers the required decision points: which parameters are match criteria, which are actions, the minimum combination rule, the label existence requirement, the future-only behavior, and how to handle existing backlog. The agent has enough context to invoke the tool correctly and to route related tasks to modify_labels or search.

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, but the description adds meaningful grouping beyond the schema: it separates match criteria from actions, defines the convenience flags (archive/mark_read/delete/star), and explains that add_labels/remove_labels accept names or ids. This helps an agent select and combine parameters correctly without needing to infer relationships from the flat 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?

The description clearly states the verb 'Create a Gmail filter' and the resource, and immediately differentiates it from modify_labels by noting this is the 'durable fix' for recurring noise versus touching only existing messages. This makes the tool's purpose unmistakable even among many siblings.

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?

The description explicitly names the alternative tool modify_labels, explains when it is the wrong choice ('only touches existing messages'), and even instructs the agent to 'clear existing backlog with search + modify_labels.' It also states that filters cannot forward mail off-account, removing a potential misapplication.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cunicopia-dev/gmail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server