Skip to main content
Glama

Create Email Rule

emailrules_create

Automatically process incoming emails by creating rules that move, forward, categorize, or delete messages based on conditions like sender, subject, or attachments.

Instructions

✏️ Create a new inbox message rule to automatically process emails (requires user confirmation recommended)

Rules are executed in priority order (sequence number).

Conditions examples: {"fromAddresses": [{"address": "john@example.com"}]} {"subjectContains": ["urgent", "important"]} {"senderContains": ["@company.com"]} {"hasAttachments": true}

Actions examples: {"moveToFolder": "folder_id"} {"markAsRead": true} {"forwardTo": [{"emailAddress": {"address": "manager@example.com"}}]} {"assignCategories": ["Red category"]} {"delete": true}

Args: account_id: Microsoft account ID display_name: Name for the rule (e.g., "Move work emails to Projects") conditions: Conditions that trigger the rule actions: Actions to perform when conditions match sequence: Rule execution order (lower numbers execute first, default: 1) is_enabled: Whether the rule is active (default: True) exceptions: Optional conditions that prevent rule execution

Returns: Created rule with its ID and full configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes
display_nameYes
conditionsYes
actionsYes
sequenceNo
is_enabledNo
exceptionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations provide readOnlyHint=false and destructiveHint=false, which the description complements by indicating the tool creates rules (write operation) and recommending user confirmation. It also explains execution order, adding behavioral context beyond annotations. However, it doesn't detail failure modes or side effects.

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?

The description is well-structured with sections for purpose, behavior, examples, arguments, and returns. It is front-loaded with the key purpose. While comprehensive, it is slightly longer than necessary; the examples could be more concise.

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 (7 parameters, nested objects, no output schema in structured input), the description is thorough. It explains conditions/actions with examples, covers all parameters, and describes the return value. It is complete enough for an agent to understand and use the tool.

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

Parameters5/5

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

Although the input schema lacks parameter descriptions (coverage 0%), the description compensates with a detailed 'Args' list explaining each parameter, including default values and examples for complex objects like conditions and actions. This adds significant semantic value.

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 explicitly states the tool creates a new inbox message rule to automatically process emails, using a specific verb and resource. It clearly distinguishes itself from sibling tools like emailrules_update or emailrules_list by focusing on creation.

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

Usage Guidelines3/5

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

The description mentions that user confirmation is recommended and explains priority order, but does not specify when to avoid using this tool or provide explicit comparisons to siblings like emailrules_update. It lacks guidance on prerequisites or scenarios where the tool should not be used.

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/robin-collins/m365-mcp'

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