outlook-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Outlook Automation via Rube MCP

通过Rube MCP实现Outlook自动化

Automate Microsoft Outlook operations through Composio's Outlook toolkit via Rube MCP.
通过Rube MCP,借助Composio的Outlook工具包自动化Microsoft Outlook操作。

Prerequisites

前提条件

  • Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
  • Active Outlook connection via
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    outlook
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(可使用RUBE_SEARCH_TOOLS)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    并选择工具包
    outlook
    ,已激活Outlook连接
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具架构

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    outlook
  3. If connection is not ACTIVE, follow the returned auth link to complete Microsoft OAuth
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥 —— 只需添加端点即可使用。
  1. 确认
    RUBE_SEARCH_TOOLS
    可正常响应,以此验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包
    outlook
  3. 如果连接未处于ACTIVE状态,请按照返回的授权链接完成Microsoft OAuth认证
  4. 在运行任何工作流之前,确认连接状态显示为ACTIVE

Core Workflows

核心工作流

1. Search and Filter Emails

1. 搜索和筛选邮件

When to use: User wants to find specific emails across their mailbox
Tool sequence:
  1. OUTLOOK_SEARCH_MESSAGES
    - Search with KQL syntax across all folders [Required]
  2. OUTLOOK_GET_MESSAGE
    - Get full message details [Optional]
  3. OUTLOOK_LIST_OUTLOOK_ATTACHMENTS
    - List message attachments [Optional]
  4. OUTLOOK_DOWNLOAD_OUTLOOK_ATTACHMENT
    - Download attachment [Optional]
Key parameters:
  • query
    : KQL search string (from:, to:, subject:, received:, hasattachment:)
  • from_index
    : Pagination start (0-based)
  • size
    : Results per page (max 25)
  • message_id
    : Message ID (use hitId from search results)
Pitfalls:
  • Only works with Microsoft 365/Enterprise accounts (not @hotmail.com/@outlook.com)
  • Pagination relies on hitsContainers[0].moreResultsAvailable; stop only when false
  • Use hitId from search results as message_id for downstream calls, not resource.id
  • Index latency: very recent emails may not appear immediately
  • Inline images appear as attachments; filter by mimetype for real documents
适用场景:用户需要在邮箱中查找特定邮件
工具执行序列:
  1. OUTLOOK_SEARCH_MESSAGES
    - 使用KQL语法跨所有文件夹搜索 [必填]
  2. OUTLOOK_GET_MESSAGE
    - 获取完整邮件详情 [可选]
  3. OUTLOOK_LIST_OUTLOOK_ATTACHMENTS
    - 列出邮件附件 [可选]
  4. OUTLOOK_DOWNLOAD_OUTLOOK_ATTACHMENT
    - 下载附件 [可选]
关键参数:
  • query
    : KQL搜索字符串(from:, to:, subject:, received:, hasattachment:)
  • from_index
    : 分页起始位置(从0开始)
  • size
    : 每页结果数量(最大25)
  • message_id
    : 邮件ID(使用搜索结果中的hitId)
注意事项:
  • 仅适用于Microsoft 365/企业账户(不支持@hotmail.com/@outlook.com)
  • 分页依赖hitsContainers[0].moreResultsAvailable;仅当该值为false时停止
  • 下游调用请使用搜索结果中的hitId作为message_id,而非resource.id
  • 索引延迟:最新邮件可能不会立即显示
  • 内嵌图片会被视为附件;可通过mimetype筛选真实文档

2. Query Emails in a Folder

2. 查询指定文件夹中的邮件

When to use: User wants to list emails in a specific folder with OData filters
Tool sequence:
  1. OUTLOOK_LIST_MAIL_FOLDERS
    - List mail folders to get folder IDs [Prerequisite]
  2. OUTLOOK_QUERY_EMAILS
    - Query emails with structured filters [Required]
Key parameters:
  • folder
    : Folder name ('inbox', 'sentitems', 'drafts') or folder ID
  • filter
    : OData filter (e.g.,
    isRead eq false and importance eq 'high'
    )
  • top
    : Max results (1-1000)
  • orderby
    : Sort field and direction
  • select
    : Array of fields to return
Pitfalls:
  • QUERY_EMAILS searches a SINGLE folder only; use SEARCH_MESSAGES for cross-folder search
  • Custom folders require folder IDs, not display names; use LIST_MAIL_FOLDERS
  • Always check response['@odata.nextLink'] for pagination
  • Cannot filter by recipient or body content; use SEARCH_MESSAGES for that
适用场景:用户需要使用OData筛选器列出特定文件夹中的邮件
工具执行序列:
  1. OUTLOOK_LIST_MAIL_FOLDERS
    - 列出邮件文件夹以获取文件夹ID [前提步骤]
  2. OUTLOOK_QUERY_EMAILS
    - 使用结构化筛选器查询邮件 [必填]
关键参数:
  • folder
    : 文件夹名称('inbox', 'sentitems', 'drafts')或文件夹ID
  • filter
    : OData筛选器(例如:
    isRead eq false and importance eq 'high'
  • top
    : 最大结果数量(1-1000)
  • orderby
    : 排序字段和方向
  • select
    : 要返回的字段数组
注意事项:
  • QUERY_EMAILS仅搜索单个文件夹;跨文件夹搜索请使用SEARCH_MESSAGES
  • 自定义文件夹需要使用文件夹ID而非显示名称;请使用LIST_MAIL_FOLDERS获取
  • 请始终检查response['@odata.nextLink']以处理分页
  • 无法按收件人或邮件正文内容筛选;此类需求请使用SEARCH_MESSAGES

3. Manage Calendar Events

3. 管理日历事件

When to use: User wants to list, search, or inspect calendar events
Tool sequence:
  1. OUTLOOK_LIST_EVENTS
    - List events with filters [Optional]
  2. OUTLOOK_GET_CALENDAR_VIEW
    - Get events in a time window [Optional]
  3. OUTLOOK_GET_EVENT
    - Get specific event details [Optional]
  4. OUTLOOK_LIST_CALENDARS
    - List available calendars [Optional]
  5. OUTLOOK_GET_SCHEDULE
    - Get free/busy info [Optional]
Key parameters:
  • filter
    : OData filter (use start/dateTime, NOT receivedDateTime)
  • start_datetime
    /
    end_datetime
    : ISO 8601 for calendar view
  • timezone
    : IANA timezone (e.g., 'America/New_York')
  • calendar_id
    : Optional non-primary calendar ID
  • select
    : Fields to return
Pitfalls:
  • Use calendar event properties only (start/dateTime, end/dateTime), NOT email properties (receivedDateTime)
  • Calendar view requires start_datetime and end_datetime
  • Recurring events need
    expand_recurring_events=true
    to see individual occurrences
  • Decline status is per-attendee via attendees[].status.response
适用场景:用户需要列出、搜索或查看日历事件详情
工具执行序列:
  1. OUTLOOK_LIST_EVENTS
    - 使用筛选器列出事件 [可选]
  2. OUTLOOK_GET_CALENDAR_VIEW
    - 获取指定时间范围内的事件 [可选]
  3. OUTLOOK_GET_EVENT
    - 获取特定事件的详情 [可选]
  4. OUTLOOK_LIST_CALENDARS
    - 列出可用日历 [可选]
  5. OUTLOOK_GET_SCHEDULE
    - 获取忙/闲信息 [可选]
关键参数:
  • filter
    : OData筛选器(使用start/dateTime,而非receivedDateTime)
  • start_datetime
    /
    end_datetime
    : 用于日历视图的ISO 8601格式时间
  • timezone
    : IANA时区(例如:'America/New_York')
  • calendar_id
    : 可选的非主日历ID
  • select
    : 要返回的字段
注意事项:
  • 仅使用日历事件属性(start/dateTime, end/dateTime),而非邮件属性(receivedDateTime)
  • 日历视图需要指定start_datetime和end_datetime
  • 重复事件需要设置
    expand_recurring_events=true
    以查看单个实例
  • 拒绝状态需通过attendees[].status.response查看每个参与者的状态

4. Manage Contacts

4. 管理联系人

When to use: User wants to list, create, or organize contacts
Tool sequence:
  1. OUTLOOK_LIST_CONTACTS
    - List contacts [Optional]
  2. OUTLOOK_CREATE_CONTACT
    - Create a new contact [Optional]
  3. OUTLOOK_GET_CONTACT_FOLDERS
    - List contact folders [Optional]
  4. OUTLOOK_CREATE_CONTACT_FOLDER
    - Create contact folder [Optional]
Key parameters:
  • givenName
    /
    surname
    : Contact name
  • emailAddresses
    : Array of email objects
  • displayName
    : Full display name
  • contact_folder_id
    : Optional folder for contacts
Pitfalls:
  • Contact creation supports many fields but only givenName or surname is needed
适用场景:用户需要列出、创建或整理联系人
工具执行序列:
  1. OUTLOOK_LIST_CONTACTS
    - 列出联系人 [可选]
  2. OUTLOOK_CREATE_CONTACT
    - 创建新联系人 [可选]
  3. OUTLOOK_GET_CONTACT_FOLDERS
    - 列出联系人文件夹 [可选]
  4. OUTLOOK_CREATE_CONTACT_FOLDER
    - 创建联系人文件夹 [可选]
关键参数:
  • givenName
    /
    surname
    : 联系人姓名
  • emailAddresses
    : 邮箱对象数组
  • displayName
    : 完整显示名称
  • contact_folder_id
    : 可选的联系人存放文件夹ID
注意事项:
  • 创建联系人支持多个字段,但仅需提供givenName或surname即可

5. Manage Mail Folders

5. 管理邮件文件夹

When to use: User wants to organize mail folders
Tool sequence:
  1. OUTLOOK_LIST_MAIL_FOLDERS
    - List top-level folders [Required]
  2. OUTLOOK_LIST_CHILD_MAIL_FOLDERS
    - List subfolders [Optional]
  3. OUTLOOK_CREATE_MAIL_FOLDER
    - Create a new folder [Optional]
Key parameters:
  • parent_folder_id
    : Well-known name or folder ID
  • displayName
    : New folder name
  • include_hidden_folders
    : Show hidden folders
Pitfalls:
  • Well-known folder names: 'inbox', 'sentitems', 'drafts', 'deleteditems', 'junkemail', 'archive'
  • Custom folder operations require the folder ID, not display name
适用场景:用户需要整理邮件文件夹
工具执行序列:
  1. OUTLOOK_LIST_MAIL_FOLDERS
    - 列出顶级文件夹 [必填]
  2. OUTLOOK_LIST_CHILD_MAIL_FOLDERS
    - 列出子文件夹 [可选]
  3. OUTLOOK_CREATE_MAIL_FOLDER
    - 创建新文件夹 [可选]
关键参数:
  • parent_folder_id
    : 知名文件夹名称或文件夹ID
  • displayName
    : 新文件夹名称
  • include_hidden_folders
    : 是否显示隐藏文件夹
注意事项:
  • 知名文件夹名称:'inbox', 'sentitems', 'drafts', 'deleteditems', 'junkemail', 'archive'
  • 自定义文件夹操作需要使用文件夹ID,而非显示名称

Common Patterns

常见模式

KQL Search Syntax

KQL搜索语法

Property filters:
  • from:user@example.com
    - From sender
  • to:recipient@example.com
    - To recipient
  • subject:invoice
    - Subject contains
  • received>=2025-01-01
    - Date filter
  • hasattachment:yes
    - Has attachments
Combinators:
  • AND
    - Both conditions
  • OR
    - Either condition
  • Parentheses for grouping
属性筛选器:
  • from:user@example.com
    - 发件人
  • to:recipient@example.com
    - 收件人
  • subject:invoice
    - 主题包含指定内容
  • received>=2025-01-01
    - 日期筛选
  • hasattachment:yes
    - 包含附件
组合符:
  • AND
    - 同时满足两个条件
  • OR
    - 满足任一条件
  • 括号用于分组

OData Filter Syntax

OData筛选器语法

Email filters:
  • isRead eq false
    - Unread emails
  • importance eq 'high'
    - High importance
  • hasAttachments eq true
    - Has attachments
  • receivedDateTime ge 2025-01-01T00:00:00Z
    - Date filter
Calendar filters:
  • start/dateTime ge '2025-01-01T00:00:00Z'
    - Events after date
  • contains(subject, 'Meeting')
    - Subject contains text
邮件筛选器:
  • isRead eq false
    - 未读邮件
  • importance eq 'high'
    - 高优先级
  • hasAttachments eq true
    - 包含附件
  • receivedDateTime ge 2025-01-01T00:00:00Z
    - 日期筛选
日历筛选器:
  • start/dateTime ge '2025-01-01T00:00:00Z'
    - 指定日期之后的事件
  • contains(subject, 'Meeting')
    - 主题包含指定文本

Known Pitfalls

已知注意事项

Account Types:
  • SEARCH_MESSAGES requires Microsoft 365/Enterprise accounts
  • Personal accounts (@hotmail.com, @outlook.com) have limited API access
Field Confusion:
  • Email properties (receivedDateTime) differ from calendar properties (start/dateTime)
  • Do NOT use email fields in calendar queries or vice versa
账户类型:
  • SEARCH_MESSAGES仅支持Microsoft 365/企业账户
  • 个人账户(@hotmail.com, @outlook.com)的API访问权限有限
字段混淆:
  • 邮件属性(receivedDateTime)与日历属性(start/dateTime)不同
  • 请勿在日历查询中使用邮件字段,反之亦然

Quick Reference

快速参考

TaskTool SlugKey Params
Search emailsOUTLOOK_SEARCH_MESSAGESquery, from_index, size
Query folderOUTLOOK_QUERY_EMAILSfolder, filter, top
Get messageOUTLOOK_GET_MESSAGEmessage_id
List attachmentsOUTLOOK_LIST_OUTLOOK_ATTACHMENTSmessage_id
Download attachmentOUTLOOK_DOWNLOAD_OUTLOOK_ATTACHMENTmessage_id, attachment_id
List foldersOUTLOOK_LIST_MAIL_FOLDERS(none)
Child foldersOUTLOOK_LIST_CHILD_MAIL_FOLDERSparent_folder_id
List eventsOUTLOOK_LIST_EVENTSfilter, timezone
Calendar viewOUTLOOK_GET_CALENDAR_VIEWstart_datetime, end_datetime
Get eventOUTLOOK_GET_EVENTevent_id
List calendarsOUTLOOK_LIST_CALENDARS(none)
Free/busyOUTLOOK_GET_SCHEDULEschedules, times
List contactsOUTLOOK_LIST_CONTACTStop, filter
Create contactOUTLOOK_CREATE_CONTACTgivenName, emailAddresses
Contact foldersOUTLOOK_GET_CONTACT_FOLDERS(none)

Powered by Composio
任务工具标识关键参数
搜索邮件OUTLOOK_SEARCH_MESSAGESquery, from_index, size
查询文件夹邮件OUTLOOK_QUERY_EMAILSfolder, filter, top
获取邮件详情OUTLOOK_GET_MESSAGEmessage_id
列出附件OUTLOOK_LIST_OUTLOOK_ATTACHMENTSmessage_id
下载附件OUTLOOK_DOWNLOAD_OUTLOOK_ATTACHMENTmessage_id, attachment_id
列出邮件文件夹OUTLOOK_LIST_MAIL_FOLDERS
列出子文件夹OUTLOOK_LIST_CHILD_MAIL_FOLDERSparent_folder_id
列出日历事件OUTLOOK_LIST_EVENTSfilter, timezone
获取日历视图OUTLOOK_GET_CALENDAR_VIEWstart_datetime, end_datetime
获取事件详情OUTLOOK_GET_EVENTevent_id
列出日历OUTLOOK_LIST_CALENDARS
获取忙/闲信息OUTLOOK_GET_SCHEDULEschedules, times
列出联系人OUTLOOK_LIST_CONTACTStop, filter
创建联系人OUTLOOK_CREATE_CONTACTgivenName, emailAddresses
列出联系人文件夹OUTLOOK_GET_CONTACT_FOLDERS

Composio 提供支持