Skip to main content
Glama
langmail-mcp

langmail-mcp

Official
by langmail

Create mail rule

create_mail_rule

Set up a persistent mail rule that automatically sorts, labels, archives, or forwards future incoming messages until disabled or deleted; use it for ongoing filtering, not one-time cleanup.

Instructions

Create a persistent mail rule (filter) that automatically sorts, labels, archives or forwards FUTURE incoming messages until it is disabled or deleted. Use ONLY when the user expresses ongoing behavior — "automatically…", "from now on…", "whenever I receive…". If a request is ambiguous between a one-time cleanup and a standing rule (e.g. "archive all GitHub notifications"), ask which they mean first. Rules run server-side on arrival; every rule whose conditions match runs. Existing mail is untouched unless you pass existingMail (preview_mail_rule first — large backfills need explicit confirmation). Returns the created rule with its id.

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": {
      "actions": "<actions>",
      "conditions": "<conditions>"
    },
    "name": "create_mail_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoOptional human-readable rule name, e.g. "Archive GitHub Notifications".
matchNoHow multiple conditions combine: "all" = every condition must match (AND), "any" = one is enough (OR).all
actionsYesWhat happens to a matching message — one or more actions, applied in order.
conditionsYesWhen the rule fires; at least one is required. Matching is case-insensitive substring matching.
existingMailNoOptionally also apply the actions to mail already in the mailbox. Omit (or mode "none") to affect future mail only — the safe default unless the user asked for a cleanup too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent write. The description adds real behavior beyond them: rules execute server-side on arrival, all matching rules run, existing mail is untouched by default, and large backfills require explicit confirmation. It doesn't address what happens with duplicate/near-identical rules or required permissions, which leaves a small gap.

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-loaded with the what and the when, then safety notes, then return value. Several parenthetical asides (preview-first, large backfills) make it dense but each sentence carries information; only mild tightening is 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 nested, multi-action write tool with no output schema, the description covers scope (future vs existing mail), execution semantics, disambiguation guidance, and the return value (created rule with its id). An agent has everything needed to call it correctly.

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 description coverage is 100%, so parameters are already well documented (including existingMail modes and confirmLargeApply's 200-message threshold). The description only adds workflow advice — preview first, confirm counts — rather than new semantics, so baseline 3 fits.

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 ("Create a persistent mail rule (filter)") plus the concrete effects — sorts, labels, archives, forwards — and scopes it to FUTURE incoming messages until disabled or deleted. This clearly separates it from preview_mail_rule, update_mail_rule, and delete_mail_rule without opening their schemas.

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 an explicit gating condition ("Use ONLY when the user expresses ongoing behavior") with example phrasings, plus a disambiguation instruction for the one-time-cleanup vs standing-rule case. It also routes the agent to preview_mail_rule before backfilling existing mail.

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