文档

outlook-contacts

试用

Read and write the signed-in user's Microsoft 365 / Outlook.com personal contacts via Microsoft Graph. No mail, no files, no directory access. Use when the user wants to list/search Outlook.com contacts, find phone numbers, or look up email addresses. Trigger keywords: "outlook contacts", "ms contacts", "graph contacts", "我的联系人", "查联系人", "outlook 联系人".

它能做什么

Read and write the signed-in user's Microsoft 365 / Outlook.com personal contacts via Microsoft Graph. No mail, no files, no directory access. Use when the user wants to list/search Outlook.com contacts, find phone numbers, or look up email addresses. Trigger keywords: "outlook contacts", "ms contacts", "graph contacts", "我的联系人", "查联系人", "outlook 联系人".

技能文档

Outlook Contacts (Microsoft Graph, read & write)

A contacts read-and-write Microsoft Graph skill. Reads and writes the signed-in user's personal contacts through /me/contacts. Does not access mail/files/directory.

All write operations (create, update, delete) default to dry-run; you must pass --apply to execute.

⚠️ Shared auth with outlook-calendar & outlook-todo

This skill reuses the same config and tokens under ~/.outlook-graph/, but it needs the Contacts.ReadWrite scope (in addition to the existing scopes from the calendar/todo skills).

If you already have outlook-calendar set up, you'll need to re-authenticate once to add the Contacts.ReadWrite permission. Run the combined setup:

cd ~/.openclaw/skills/outlook-calendar
./scripts/setup-device-code.sh --client-id  --tenant-id common --force

⚠️ This will ask you to re-consent with an extended scope that includes Contacts.ReadWrite.

For personal Outlook.com accounts, Azure Portal preconfiguration is usually unnecessary — Microsoft supports dynamic consent, and the setup script will request the new scope at login.

Scopes required

ScopeWhy
offline_accessrefresh_token for headless operation
https://graph.microsoft.com/User.Readdisplay signed-in account UPN
https://graph.microsoft.com/Contacts.ReadWriteread and write personal contacts

The existing setup-device-code.sh in outlook-calendar also includes Calendars.ReadWrite and Tasks.ReadWrite for the calendar/todo skills. They coexist in the same token.

Reading contacts

# List all contacts (paginated, max 200 per page)
./scripts/contacts-read.sh list --format summary

# Search contacts by name, email, or company
./scripts/contacts-read.sh search "jane" --format summary

# Filter by specific field
./scripts/contacts-read.sh list --filter "contains(displayName,'Zhang')" --format json

# Limit results
./scripts/contacts-read.sh list --limit 20 --format summary

# Raw JSON output
./scripts/contacts-read.sh list --format raw

--format options:

  • summary (default) — compact table: name, email, phone, company, title
  • json — pretty-printed full Graph JSON
  • simple — one line per contact: "name 📞phone"
  • raw — single-line JSON array

Format examples

summary (default):

NAME                 EMAIL                        PHONE            COMPANY         TITLE
----------------------------------------------------------------------------------------------------

Zhang San            zhang@example.com            13812345678      ABC Corp        Manager
Li Si                li@example.com               13987654321      -               -

Total: 2 contacts

simple — one line per contact with optional phone icon:

Zhang San  📞13812345678
Li Si 

Search syntax

The search subcommand uses Microsoft Graph's $search query parameter on the displayName and emailAddresses fields:

./scripts/contacts-read.sh search "Wang" --format simple
./scripts/contacts-read.sh search "gmail.com" --format summary

Filtering

The --filter option passes an OData $filter expression directly:

./scripts/contacts-read.sh list --filter "jobTitle eq 'Professor'" --format summary
./scripts/contacts-read.sh list --filter "startswith(givenName,'X')" --format json

Writing contacts

⚠️ Safety: every write defaults to dry-run. Pass --apply to execute.

# Get a single contact (read-only, no --apply needed)
./scripts/contacts-write.sh get --contact-id "AAMk..."

# Update a contact (dry-run by default; see payload before applying)
./scripts/contacts-write.sh update --contact-id "AAMk..." \
  --email "new@example.com" --phone "13812345678"

# Actually update (after confirming dry-run output looks correct)
./scripts/contacts-write.sh update --contact-id "AAMk..." \
  --email "new@example.com" --phone "13812345678" --apply

# Create a new contact
./scripts/contacts-write.sh create --display-name "Zhang San" \
  --email "zhang@example.com" --phone "13912345678" --apply

# Delete a contact (always shows the contact first, then asks for YES confirmation)
./scripts/contacts-write.sh delete --contact-id "AAMk..." --apply

Update fields available

  • --display-name — full display name
  • --given-name — first name
  • --surname — last name
  • --email — primary email (replaces existing email array)
  • --phone — mobile phone number
  • --company — company name
  • --job-title — job title
  • --notes — personal notes

Files in this skill

PathPurpose
SKILL.mdthis file
scripts/contacts-read.shlist / search contacts via /me/contacts
scripts/contacts-write.shget / update / create / delete contacts

Troubleshooting

  • token scope does not include Contacts.ReadWrite — you need to re-run the outlook-calendar setup script with --force to re-authenticate and get the extended scope.
  • Empty results — check that contacts exist in Outlook.com under "People".
  • 401 Unauthorized — run scripts/token.sh refresh in the outlook-calendar skill.

相关技能

Read and write the signed-in user's Microsoft 365 / Outlook.com personal calendar via Microsoft Graph. Calendar API surface only — but note: this skill shares one device-code login with the outlook-contacts and outlook-todo skills, so the shared consent also grants their Calendars/Tasks/Contacts read-write scopes (fully disclosed in the Scope table below). Use when the user wants to list today's events, look at next week, create / update / delete a single event by id, or check token status. Trigger keywords: "outlook calendar", "ms calendar", "graph calendar", "我的 outlook 日历", "微软日历".

通过 Microsoft Graph 接入 Outlook,读取、发送、管理邮件、文件夹、日历事件和联系人,OAuth 由平台托管。

作者 byungkyu

让 OpenClaw 代理通过 Microsoft Graph API 接入个人微软账户,读写 Outlook 邮件、日历事件和 To Do 任务。

74 次安装2 星标

ContactOut (contactout.com). Use this skill for ANY ContactOut request — searching and reading data. Whenever a task involves ContactOut, use this skill inst...

1 次安装

Production-grade Microsoft 365 MCP server with delegated OAuth, multi-account support, pagination, rate limiting, and 46 tools covering email, calendar, contacts, OneDrive, Teams, tasks, and users.

1 次安装

为 AI agent 提供对个人 Outlook.com / Hotmail / Live 邮箱的完整 Microsoft Graph 访问能力。

41 次安装1 星标