Skip to main content
Glama
Paperless-NGX MCP Server

Paperless-NGX MCP Server

create_mail_rule

Create Paperless-NGX mail rules to process incoming emails and attachments by account, folder, filters, and actions; use attachment-only rules for invoices unless full messages must be archived.

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. Changed3 schema fields changedv2.4.1
    • changedInput schema / properties / action_parameter / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 256,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / filter_attachment_filename_exclude / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 256,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / filter_attachment_filename_include / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 256,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. First observedv2.2.1

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden of behavioral disclosure. It says nothing about mutation effects, required permissions, duplicate-name behavior, or what a created rule returns; for a 24-parameter write tool this leaves significant gaps.

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?

Two short sentences, front-loaded with the core action, then prerequisite, then recommendation. No filler or repetition.

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?

A tool with 24 parameters, no annotations, no output schema, and 25% parameter coverage needs far more descriptive scaffolding than two sentences. The agent knows it creates a rule and should pick an account, but not how to configure the many rule behaviors or what the result looks like.

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?

Schema description coverage is only 25% across 24 parameters, so the description is expected to compensate and largely does not. It only hints at the account field and the attachment-vs-full-mail choice, leaving action, consumption_scope, pdf_layout, assign_title_from, correspondent assignment, filters, and tagging undocumented outside partial schema notes.

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?

States a specific verb and resource ('Create a Paperless mail rule'), which is unambiguous on its own. It does not differentiate itself from the sibling 'update_mail_rule' or clarify how it relates to 'list_mail_rules', so the agent must infer that this creates new rules rather than modifies existing ones.

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?

Gives a concrete prerequisite workflow ('Use list_mail_accounts first to choose account') and a design recommendation ('Prefer attachment-only rules for invoices unless the full mail must be archived'). Neither is a true when-not or an alternative-tool routing rule (e.g., create vs update), so it falls short of a 5.

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