Skip to main content
Glama

create_mail_rule

Destructive

Create a Paperless mail rule to filter incoming email and import attachments or full messages. Define account, folder, filters, and actions to automate document capture.

Instructions

Create a Paperless mail rule. Use list_mail_accounts first to choose account. Prefer attachment-only rules for invoices unless the full mail must be archived.

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": {
      "name": "<name>",
      "account": "<account>",
      "folder": "<folder>"
    },
    "name": "create_mail_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
orderNo
ownerNo
actionNoMail rule action: 1=Delete, 2=Move to specified folder, 3=Mark as read/don't process read mails, 4=Flag/don't process flagged mails, 5=Tag/don't process tagged mails
folderYes
accountYes
enabledNo
filter_toNo
pdf_layoutNoPDF layout for full-mail consumption: 0=System default, 1=Text then HTML, 2=HTML then text, 3=HTML only, 4=Text only
assign_tagsNo
filter_bodyNo
filter_fromNo
maximum_ageNo
filter_subjectNo
attachment_typeNoAttachment type: 1=Only process attachments, 2=Process all files including inline attachments
action_parameterNo
assign_title_fromNoTitle assignment: 1=Use subject as title, 2=Use attachment filename as title, 3=Do not assign title from rule
consumption_scopeNoConsumption scope: 1=Only process attachments, 2=Process full mail as .eml, 3=Process full mail and attachments separately
assign_correspondentNo
assign_document_typeNo
assign_owner_from_ruleNo
assign_correspondent_fromNoCorrespondent assignment: 1=Do not assign, 2=Use mail address, 3=Use sender name or address, 4=Use assign_correspondent
filter_attachment_filename_excludeNo
filter_attachment_filename_includeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, and idempotentHint=false, so the mutation profile is covered structurally. The description adds the account-selection prerequisite and the attachment-vs-full-mail trade-off, but says nothing about what the rule affects once enabled, whether it runs immediately, or any side effects of the destructive default.

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 short sentences, front-loaded with the action, then the prerequisite, then the recommendation. Nothing is redundant and no sentence could be dropped without losing information.

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

Completeness2/5

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

For a destructive write tool with 24 parameters, thin schema documentation, and no output schema, three sentences are far from sufficient. The agent must infer the meaning of most configuration fields and has no guidance on defaults, required-vs-optional behavior, or the consequence of enabling a rule.

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

Parameters2/5

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

With 24 parameters and only 25% schema description coverage, the description must carry substantial semantic weight, and it does not. The attachment/full-mail sentence loosely gestures at consumption_scope and attachment_type, but the many filter_*, assign_*, order, owner, maximum_age, and action_parameter fields get no explanation at all.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Create a Paperless mail rule'), which immediately distinguishes it from get_mail_rule, update_mail_rule, and delete_mail_rule. It stops short of naming any of those siblings explicitly, so the differentiation relies on the verb alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete prerequisite ('Use list_mail_accounts first to choose account') and a stated preference ('Prefer attachment-only rules for invoices unless the full mail must be archived'), which is real when-to-use guidance. It does not address when a rule should be updated or deleted instead of created, but that gap is minor.

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