Skip to main content
Glama

manage_gmail_filter

Create or delete Gmail filters using customizable criteria and actions. Automate email organization by labeling, forwarding, or archiving messages.

Instructions

Create or delete a server-side Gmail filter.

Side effects: creates a persistent auto-action rule or permanently deletes one. Filter updates are not supported by the Gmail API — delete and recreate instead. Use list_gmail_filters first to inspect existing filters. Requires the gmail.settings.basic OAuth scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYesThe user's Google email address (authenticated account).
actionYes"create" or "delete". Case-insensitive.
criteriaNoFilter match criteria for create. Keys: from, to, subject, query (Gmail search operators like "label:INBOX older_than:30d"), negatedQuery, hasAttachment, size, sizeComparison, excludeChats. Example: {"from": "newsletter@", "subject": "deal"}.
filter_actionNoWhat to do on match for create. Keys: addLabelIds (list of label IDs from list_gmail_labels), removeLabelIds, forward (alias email). Example: {"addLabelIds": ["Label_1"], "removeLabelIds": ["INBOX"]}.
filter_idNoFilter ID from list_gmail_filters. Required for delete.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses side effects (persistent auto-action rule creation or permanent deletion) and the required OAuth scope. It also notes the lack of update support, which is critical behavioral information.

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 extremely concise—two sentences that cover purpose, side effects, workaround, prerequisite, and auth requirement. No wasted words.

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?

Given the tool's complexity (5 parameters, create/delete) and the presence of an output schema, the description covers all essential behavioral context, including side effects, unsupported operations, recommended usage, and auth scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and parameter descriptions in the schema are thorough. The tool description does not add new meaning beyond the schema, so a baseline of 3 is appropriate.

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 tool creates or deletes a server-side Gmail filter, using specific verbs and resource. It distinguishes from sibling tools like 'manage_gmail_label' or 'list_gmail_filters' by focusing on filter management.

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?

Explicitly mentions that filter updates are not supported and advises to delete and recreate instead. Also recommends using 'list_gmail_filters' first to inspect existing filters, providing clear when-to-use guidance.

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

Install Server

Other Tools

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/HuntsDesk/ve-gws'

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