Skip to main content
Glama
langmail-mcp

langmail-mcp

Official
by langmail

Preview mail rule

preview_mail_rule
Read-onlyIdempotent

Preview a proposed mail rule to verify it is valid and count how many existing messages or conversations it would match before creating or applying it.

Instructions

Validate a proposed mail rule and estimate its effect WITHOUT creating or changing anything — returns whether the rule is valid, warnings, how many existing messages and conversations currently match, and a plain-language summary of what would happen. Use this before create_mail_rule when the user should see the blast radius first, and always before applying a rule to existing mail (large backfills require the count to be confirmed). This tool never modifies mail and never installs a rule.

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": "preview_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.
existingMailNoThe existing-mail policy being considered — its scope decides where matches are counted (default: inbox).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, but the description still adds substance: it never modifies mail or installs a rule, it returns warnings and current match counts, and it flags that large backfills require the count to be confirmed. The specific confirmation threshold (200) lives only in the schema, so the description stops just short of full behavioral detail.

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?

Three sentences, front-loaded with the core guarantee ('WITHOUT creating or changing anything') followed by return contents and then the when-to-use rule. No redundant restatement of the name or title.

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?

With no output schema, the description carries the return-value burden and does so by listing validity, warnings, message/conversation counts, and a summary. Together with a fully documented nested input schema and explicit safe-read annotations, an agent has everything needed to call this correctly.

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 baseline is 3; the description goes slightly beyond by tying the preview to the existingMail policy — noting that matches are counted against existing messages and conversations and that the count must be confirmed before a large apply. It does not explain match/conditions semantics, but the schema already documents those thoroughly.

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 ('Validate a proposed mail rule and estimate its effect') plus the negative scope ('WITHOUT creating or changing anything'), and enumerates the return payload (validity, warnings, match counts, plain-language summary). This clearly separates it from create_mail_rule and the other mutation 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?

Gives explicit triggering conditions: use it before create_mail_rule when the user should see the blast radius, and always before applying a rule to existing mail. It names the alternative tool by name rather than leaving the routing to inference.

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