微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📧

高效的智能邮件管理中心

Outlook · v1.0.5
效率 安全 S 级 榜单 #21 作者 byungkyu 公开目录收录
21.6k 下载 40 安装 45.9k 收藏 1 浏览

简介

基于 Maton 托管的 Microsoft Graph API,实现对 Outlook 邮件、日历和联系人的统一管理,提升办公效率。

原始描述

Microsoft Outlook API integration with managed OAuth. Read, send, and manage emails, folders, calendar events, and contacts via Microsoft Graph. Use this ski...

通过你的 Agent 添加

安装目录:outlook/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/outlook-15290/
Codex CLI~/.codex/skills/outlook-15290/
DeepSeek Harness~/.agents/skills/outlook-15290/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Outlook 技能通过 Maton 平台集成了 Microsoft Graph API,允许用户在 CLI 或通过 Python、JavaScript 等代码环境中,安全地管理 Outlook 账户。其核心功能包括:收发邮件、管理邮件文件夹(如 Inbox、Drafts)、创建和删除日历事件、管理联系人。用户只需配置 Maton API 密钥并完成 OAuth 认证,即可执行如 maton outlook message list --folder Inbox --top 25 的命令来查看收件箱,或通过 API 调用发送会议邀请。该技能支持 OData 查询参数(如 $top、$filter、$search)进行精确的数据检索和分页。

显著优点

  1. 高安全性:所有写操作(如发送邮件、创建事件)都需要用户明确审批,避免了自动化脚本的误操作风险。
  2. 统一托管与便捷认证:通过 Maton 平台进行集中式 OAuth 管理,用户无需在本地处理复杂的 Microsoft 认证流程。
  3. 多场景集成:支持 CLI、Python、JavaScript 等多种调用方式,方便开发者和普通用户将其集成到自动化工作流中。
  4. 完善的 API 支持:基于微软官方 Graph API,功能覆盖面广,不仅能处理邮件,还能同步管理日历和联系人。

潜在缺点或局限性

  1. 对第三方平台的依赖:稳定性依赖于 Maton 代理服务的可靠性,如果 Maton 服务中断,将无法访问 Outlook 数据。
  2. API 限流:受限于 Maton 平台每秒 10 次请求的速率限制,在进行大规模数据同步时可能会遇到瓶颈。
  3. 非原生体验:必须通过 Maton 代理,而不是直接调用微软 API,可能导致额外的网络延迟和调试复杂性。

适合的目标群体

  • 开发者与运维人员:需要在代码或脚本中集成 Outlook 管理功能,构建自动化邮件处理或日程同步系统。
  • 行政与商务助理:习惯使用命令行或自动化工具高效管理者、运维处理海量邮件和日程管理。
  • 多账户管理者:需要统一管理多个 Outlook 账户的用户,技能支持多连接配置和切换。

使用该技能可能存在的常规风险

  1. 数据隐私风险:虽然 OAuth 认证很安全,但所有请求经由 Maton 代理,用户需信任 Maton 不会记录或泄露邮件内容。
  2. 依赖项与服务中断:需要稳定的网络环境访问 api.maton.ai 和 graph.microsoft.com,且依赖 MATON_API_KEY 和 @maton-ai/cli 的正确配置。任何一方故障都会导致技能不可用。
  3. 账户安全:如果 Maton API 密钥泄露,攻击者可在获得 OAuth 授权的情况下接管 Outlook 的读写权限。因此必须妥善保管环境变量。

技能正文


name: outlook description: | Microsoft Outlook API integration with managed OAuth. Read, send, and manage emails, folders, calendar events, and contacts via Microsoft Graph. Use this skill when users want to interact with Outlook. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). compatibility: Requires network access and valid Maton API key metadata: author: maton version: "1.0" clawdbot: emoji: 🧠 requires: env: - MATON_API_KEY

Outlook

Access the Microsoft Outlook API (via Microsoft Graph) with managed OAuth authentication. Read, send, and manage emails, folders, calendar events, and contacts.

Quick Start

CLI:

maton outlook message list --folder Inbox --top 25
maton api '/outlook/v1.0/me/messages?$top=25'

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/outlook/v1.0/me')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://api.maton.ai/outlook/{native-api-path}

Maton proxies requests to graph.microsoft.com and automatically injects your OAuth token.

Installation

NPM:

npm install -g @maton-ai/cli

Homebrew:

brew install maton-ai/cli/maton

Authentication

CLI:

maton login                          # Opens browser for API key
maton login --interactive            # Skip browser, paste API key directly
maton whoami                         # Show current auth state

Manual:

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key
  4. Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"

Connection Management

Manage your Microsoft OAuth connections at https://api.maton.ai.

List Connections

CLI:

maton connection list outlook --status ACTIVE
maton api -X GET /connections -f app=outlook -f status=ACTIVE

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=outlook&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

CLI:

maton connection create outlook
maton api /connections -f app=outlook

Python:

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'outlook'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Get Connection

CLI:

maton connection view {connection_id}
maton api /connections/{connection_id}

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Response:

{
  "connection": {
    "connection_id": "{connection_id}",
    "status": "ACTIVE",
    "creation_time": "2025-12-08T07:20:53.488460Z",
    "last_updated_time": "2026-01-31T20:03:32.593153Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "outlook",
    "metadata": {}
  }
}

Open the returned url in a browser to complete OAuth authorization.

Delete Connection

CLI:

maton connection delete {connection_id}
maton api -X DELETE /connections/{connection_id}

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Specifying Connection

If you have multiple Outlook connections, specify which one to use:

CLI:

maton outlook message list --folder Inbox --connection {connection_id}
maton api /outlook/v1.0/me/messages --connection {connection_id}

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/outlook/v1.0/me')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If you have multiple connections, always specify the connection to ensure requests go to the intended account.

Security & Permissions

  • Access is scoped to messages, mail folders, calendar events, and contacts within the connected Outlook account.
  • All write operations require explicit user approval. Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.

API Reference

User Profile

GET /outlook/v1.0/me

Example:

maton outlook whoami

Mail Folders

List Mail Folders
GET /outlook/v1.0/me/mailFolders

Example:

maton outlook folder list
Get Mail Folder
GET /outlook/v1.0/me/mailFolders/{folderId}

Well-known folder names: Inbox, Drafts, SentItems, DeletedItems, Archive, JunkEmail

Example:

maton outlook folder view {folderId}
Create Mail Folder
POST /outlook/v1.0/me/mailFolders
Content-Type: application/json

{
  "displayName": "My Folder"
}

Example:

maton outlook folder create --name "My Folder"
Delete Mail Folder
DELETE /outlook/v1.0/me/mailFolders/{folderId}

Example:

maton outlook folder delete {folderId}
List Child Folders
GET /outlook/v1.0/me/mailFolders/{folderId}/childFolders

Example:

maton outlook folder list --parent {folderId}

Messages

List Messages
GET /outlook/v1.0/me/messages

Example:

maton outlook message list

From specific folder:

GET /outlook/v1.0/me/mailFolders/Inbox/messages

Example:

maton outlook message list --folder Inbox

With query filter:

GET /outlook/v1.0/me/messages?$filter=isRead eq false&$top=10

Example:

maton outlook message list --filter "isRead eq false" --top 10
Get Message
GET /outlook/v1.0/me/messages/{messageId}

Example:

maton outlook message view {messageId}
Create Draft
POST /outlook/v1.0/me/messages
Content-Type: application/json

{
  "subject": "Hello",
  "body": {
    "contentType": "Text",
    "content": "This is the email body."
  },
  "toRecipients": [
    {
      "emailAddress": {
        "address": "recipient@example.com"
      }
    }
  ]
}

Example:

maton outlook message draft --to recipient@example.com --subject "Hello" --body "This is the email body."
Send Message
POST /outlook/v1.0/me/sendMail
Content-Type: application/json

{
  "message": {
    "subject": "Hello",
    "body": {
      "contentType": "Text",
      "content": "This is the email body."
    },
    "toRecipients": [
      {
        "emailAddress": {
          "address": "recipient@example.com"
        }
      }
    ]
  },
  "saveToSentItems": true
}

Example:

maton outlook message send --to recipient@example.com --subject "Hello" --body "This is the email body."
Send Existing Draft
POST /outlook/v1.0/me/messages/{messageId}/send

Example:

maton outlook message send {messageId}
Update Message
PATCH /outlook/v1.0/me/messages/{messageId}
Content-Type: application/json

{
  "isRead": true
}

Example:

maton outlook message update {messageId} --read
Delete Message
DELETE /outlook/v1.0/me/messages/{messageId}

Example:

maton outlook message delete {messageId}
Move Message
POST /outlook/v1.0/me/messages/{messageId}/move
Content-Type: application/json

{
  "destinationId": "{folderId}"
}

Example:

maton outlook message move {messageId} --to {folderId}
Search Messages

Example:

maton outlook message search "quarterly report"

Calendar

List Calendars
GET /outlook/v1.0/me/calendars

Example:

maton outlook calendar list
List Events
GET /outlook/v1.0/me/calendar/events

Example:

maton outlook event list

With date filter:

GET /outlook/v1.0/me/calendar/events?$filter=start/dateTime ge '2024-01-01'&$top=10

Example:

maton outlook event list --filter "start/dateTime ge '2024-01-01'" --top 10
Get Event
GET /outlook/v1.0/me/events/{eventId}

Example:

maton outlook event view {eventId}
Create Event
POST /outlook/v1.0/me/calendar/events
Content-Type: application/json

{
  "subject": "Meeting",
  "start": {
    "dateTime": "2024-01-15T10:00:00",
    "timeZone": "UTC"
  },
  "end": {
    "dateTime": "2024-01-15T11:00:00",
    "timeZone": "UTC"
  },
  "attendees": [
    {
      "emailAddress": {
        "address": "attendee@example.com"
      },
      "type": "required"
    }
  ]
}

Example:

maton outlook event create --subject "Meeting" --start 2024-01-15T10:00:00 --end 2024-01-15T11:00:00 --timezone UTC --attendees attendee@example.com
Delete Event
DELETE /outlook/v1.0/me/events/{eventId}

Example:

maton outlook event delete {eventId}

Contacts

List Contacts
GET /outlook/v1.0/me/contacts

Example:

maton outlook contact list
Get Contact
GET /outlook/v1.0/me/contacts/{contactId}

Example:

maton outlook contact view {contactId}
Create Contact
POST /outlook/v1.0/me/contacts
Content-Type: application/json

{
  "givenName": "John",
  "surname": "Doe",
  "emailAddresses": [
    {
      "address": "john.doe@example.com"
    }
  ]
}

Example:

maton outlook contact create --given-name John --surname Doe --email john.doe@example.com
Delete Contact
DELETE /outlook/v1.0/me/contacts/{contactId}

Example:

maton outlook contact delete {contactId}

Query Parameters

Use OData query parameters:

  • $top=10 - Limit results
  • $skip=20 - Skip results (pagination)
  • $select=subject,from - Select specific fields
  • $filter=isRead eq false - Filter results
  • $orderby=receivedDateTime desc - Sort results
  • $search="keyword" - Search content

Pagination

Outlook uses cursor-based pagination. The CLI automatically paginates with '--paginate'.

Example:

maton outlook message list --folder Inbox --paginate

Code Examples

CLI

# List recent inbox messages
maton outlook message list --folder Inbox --top 25

# Send an email
maton outlook message send --to alice@example.com --subject hi --body "hello"

# Search for messages
maton outlook message search "quarterly report"

JavaScript

const response = await fetch(
  'https://api.maton.ai/outlook/v1.0/me/messages?$top=10',
  {
    headers: {
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`
    }
  }
);

Python

import os
import requests

response = requests.get(
    'https://api.maton.ai/outlook/v1.0/me/messages',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
    params={'$top': 10, '$filter': 'isRead eq false'}
)

Notes

  • Use me as the user identifier for the authenticated user
  • Message body content types: Text or HTML
  • Well-known folder names work as folder IDs: Inbox, Drafts, SentItems, etc.
  • Calendar events use ISO 8601 datetime format
  • IMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing
  • IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get "Invalid API key" errors when piping.

Error Handling

Status Meaning
400 Missing Outlook connection
401 Invalid or missing Maton API key
429 Rate limited (10 req/sec per account)
4xx/5xx Passthrough error from Microsoft Graph API

Troubleshooting: API Key Issues

CLI:

  1. Check your auth state:
maton whoami
  1. Verify the API key is valid by listing connections:
maton connection list

Manual:

  1. Check that the MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
  1. Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Troubleshooting: Invalid App Name

  1. Ensure your URL path starts with outlook. For example:
  • Correct: https://api.maton.ai/outlook/v1.0/me/messages
  • Incorrect: https://api.maton.ai/v1.0/me/messages

Resources

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

officeproductivityautomationapicustomer-support

同类 Skill