Outlook
by @junzhongjunzi
Outlook / Microsoft mail integration via Maton managed OAuth and Microsoft Graph-compatible gateway. Use when users want to read, search, summarize, draft, s...
clawhub install maton-outlookπ About This Skill
name: outlook description: | Outlook / Microsoft mail integration via Maton managed OAuth and Microsoft Graph-compatible gateway. Use when users want to read, search, summarize, draft, send, label, move, or manage Outlook / Hotmail / Live / Microsoft 365 email through an existing Maton Outlook connection. Requires MATON_API_KEY and a Maton connection with app="outlook".
Outlook
Access Outlook mail through Maton using an existing OAuth connection.
Authentication
All requests require:
Authorization: Bearer $MATON_API_KEY
Environment variable required:
MATON_API_KEY
Connection check
First verify that an active Outlook connection exists.
Control endpoint:
https://ctrl.maton.ai/connections
Look for a connection with:
outlookACTIVEIf multiple Outlook connections exist, prefer the ACTIVE one whose metadata mail/userPrincipalName matches the userβs target mailbox.
Base path
Use the Maton Outlook gateway with Microsoft Graph v1.0 style paths:
https://gateway.maton.ai/outlook/v1.0/
Examples:
https://gateway.maton.ai/outlook/v1.0/mehttps://gateway.maton.ai/outlook/v1.0/me/messages?$top=5https://gateway.maton.ai/outlook/v1.0/me/mailFolders/Inbox/messages?$top=10Preferred workflow
Prefer this order:
1. Verify Outlook connection is ACTIVE
2. Run a read-only probe on /outlook/v1.0/me
3. List recent or unread messages with a small $top
4. Read message body only when needed
5. Summarize before taking action when the inbox is noisy
6. Ask for confirmation before any write action
Fast paths for common tasks
Check recent mail
Use:
GET https://gateway.maton.ai/outlook/v1.0/me/messages?$top=5&$select=subject,receivedDateTime,from,isRead,webLink
Check unread mail
Use:
GET https://gateway.maton.ai/outlook/v1.0/me/messages?$top=10&$filter=isRead eq false&$select=subject,receivedDateTime,from,isRead,webLink
Check inbox folder specifically
Use:
GET https://gateway.maton.ai/outlook/v1.0/me/mailFolders/Inbox/messages?$top=10&$select=subject,receivedDateTime,from,isRead,webLink
Search messages
Use Graph-style $search when supported, for example:
GET https://gateway.maton.ai/outlook/v1.0/me/messages?$search="from:github.com"
If $search is not supported by the gateway, fall back to a smaller recent messages pull and filter in the client.
Read one message
Use:
GET https://gateway.maton.ai/outlook/v1.0/me/messages/{message-id}?$select=subject,from,toRecipients,ccRecipients,receivedDateTime,body,bodyPreview,isRead,webLink
Prefer bodyPreview first when the user only needs a quick triage.
Read-only examples
Profile
GET https://gateway.maton.ai/outlook/v1.0/me
Recent messages
GET https://gateway.maton.ai/outlook/v1.0/me/messages?$top=5&$select=subject,receivedDateTime,from,isRead,webLink
Unread messages
GET https://gateway.maton.ai/outlook/v1.0/me/messages?$top=10&$filter=isRead eq false&$select=subject,receivedDateTime,from,isRead,webLink
Drafting and sending
Treat drafting and sending as sensitive.
Draft message
POST https://gateway.maton.ai/outlook/v1.0/me/messages
Typical payload shape:
{ "subject": "...", "body": { "contentType": "Text", "content": "..." }, "toRecipients": [ { "emailAddress": { "address": "user@example.com" } } ] }
Send mail directly
POST https://gateway.maton.ai/outlook/v1.0/me/sendMail
Typical payload shape:
{ "message": { "subject": "...", "body": { "contentType": "Text", "content": "..." }, "toRecipients": [ { "emailAddress": { "address": "user@example.com" } } ] }, "saveToSentItems": true }
Prefer drafting or showing the final message preview before send unless the user explicitly asks for immediate sending.
Common write operations
Only do these after explicit user confirmation.
Patch a message
PATCH https://gateway.maton.ai/outlook/v1.0/me/messages/{message-id}
Move a message
POST https://gateway.maton.ai/outlook/v1.0/me/messages/{message-id}/move
Delete a message
DELETE https://gateway.maton.ai/outlook/v1.0/me/messages/{message-id}
Mark read / unread
PATCH https://gateway.maton.ai/outlook/v1.0/me/messages/{message-id}
Use payloads like:
{ "isRead": true }
or
{ "isRead": false }
Practical handling guidance
Scripts
For repeated operations, prefer the bundled helper scripts:
scripts/outlook_mail.py for read-only tasksscripts/outlook_send.py for drafting and sendingscripts/outlook_mail.py
Use it for:
Examples:
python skills/outlook/scripts/outlook_mail.py profilepython skills/outlook/scripts/outlook_mail.py recent --top 5python skills/outlook/scripts/outlook_mail.py unread --top 10python skills/outlook/scripts/outlook_mail.py get python skills/outlook/scripts/outlook_mail.py get --full python skills/outlook/scripts/outlook_mail.py search "from:github.com" --top 10scripts/outlook_send.py
Use it for:
Examples:
python skills/outlook/scripts/outlook_send.py draft --to user@example.com --subject "Hello" --body "Draft body"python skills/outlook/scripts/outlook_send.py send --to user@example.com --subject "Hello" --body "Mail body"Only use send after explicit user confirmation.
Prefer the scripts when the same request pattern would otherwise be rewritten in ad-hoc code.
References
For more reusable query and payload examples, read:
references/graph-examples.mdUse that file when you need ready-made Outlook Graph / Maton request patterns for inbox triage, message reads, folder access, drafting, sending, moving, or marking messages.
Notes
/v1.0/, prefer the explicit outlook/v1.0/... path.π Tips & Best Practices
/v1.0/, prefer the explicit outlook/v1.0/... path.